History

avcodec/ffv1dec: Check k in get_vlc_symbol()

The true problem happens in several previous get_vlc_symbol() but checking that is more expensive (involving FFABS()) here its just a simple check between 2 variables we have. Fixes: Assertion log >= k failed at libavcodec/golomb.h:406 Fixes: 429296194/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_FFV1_DEC_fuzzer-4691594622337024

Michael Niedermayer committed 1 year ago

Commit 051e0d71 parent c0f1c3e1 file · +5 −0Browse files

Showing the changes to libavcodec (1 of 1 file). Show all

Unified · Split

libavcodec/ffv1dec.c+5−0
@@ -56,6 +56,11 @@ static inline int get_vlc_symbol(GetBitContext *gb, VlcState *const state, · 55 unmodified lines
5656 k++;
5757 i += i;
5858 }
59+ if (k > bits) {
60+ ff_dlog(NULL, "k-overflow bias:%d error:%d drift:%d count:%d k:%d",
61+ state->bias, state->error_sum, state->drift, state->count, k);
62+ k = bits;
63+ }
5964
6065 v = get_sr_golomb(gb, k, 12, bits);
6166 ff_dlog(NULL, "v:%d bias:%d error:%d drift:%d count:%d k:%d",

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t