diff options
author | Michael Niedermayer <michael@niedermayer.cc> | 2021-03-09 21:39:30 +0100 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2021-03-11 16:06:33 +0100 |
commit | b87781649e2862d07fcb8d322289d89b47a530b6 (patch) | |
tree | f23e0c7333274e167ed735fc485672b941665a3d /libavcodec/4xm.c | |
parent | 1ad628d2c22664e3c16448029556d52b78fd3c88 (diff) | |
download | ffmpeg-b87781649e2862d07fcb8d322289d89b47a530b6.tar.gz |
avcodec/4xm: Check pre_gb in decode_i_block()
Fixes: Timeout
Fixes: 31257/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_FOURXM_fuzzer-5150866229297152
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavcodec/4xm.c')
-rw-r--r-- | libavcodec/4xm.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/libavcodec/4xm.c b/libavcodec/4xm.c index 4d58b093f7..cbd8637763 100644 --- a/libavcodec/4xm.c +++ b/libavcodec/4xm.c @@ -499,8 +499,8 @@ static int decode_i_block(FourXContext *f, int16_t *block) { int code, i, j, level, val; - if (get_bits_left(&f->gb) < 2){ - av_log(f->avctx, AV_LOG_ERROR, "%d bits left before decode_i_block()\n", get_bits_left(&f->gb)); + if (get_bits_left(&f->pre_gb) < 2) { + av_log(f->avctx, AV_LOG_ERROR, "%d bits left before decode_i_block()\n", get_bits_left(&f->pre_gb)); return AVERROR_INVALIDDATA; } |