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>
This commit is contained in:
Michael Niedermayer 2019-02-25 13:26:25 +01:00
parent 5cf42f65b6
commit 951bb7632f
1 changed files with 3 additions and 0 deletions

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);