Browse Source

avcodec/aic: Check remaining bits in aic_decode_coeffs()

Fixes: Timeout (78 seconds -> 2 seconds)
Fixes: 13186/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_AIC_fuzzer-5639516533030912

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
tags/n4.2
Michael Niedermayer 6 years ago
parent
commit
951bb7632f
1 changed files with 3 additions and 0 deletions
  1. +3
    -0
      libavcodec/aic.c

+ 3
- 0
libavcodec/aic.c View File

@@ -208,6 +208,9 @@ static int aic_decode_coeffs(GetBitContext *gb, int16_t *dst,
int mb, idx;
unsigned val;

if (get_bits_left(gb) < 5)
return AVERROR_INVALIDDATA;

has_skips = get_bits1(gb);
coeff_type = get_bits1(gb);
coeff_bits = get_bits(gb, 3);


Loading…
Cancel
Save