Commit 2c7975fe authored by Michael Niedermayer's avatar Michael Niedermayer

avcodec/qdmc: Check input space in qdmc_get_vlc()

Fixes: Timeout (125sec -> 0.4sec)
Fixes: 18059/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_QDMC_fuzzer-5656195825664000

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpegReviewed-by: 's avatarPaul B Mahol <onemda@gmail.com>
Signed-off-by: 's avatarMichael Niedermayer <michael@niedermayer.cc>
parent f76a899a
...@@ -367,6 +367,8 @@ static int qdmc_get_vlc(GetBitContext *gb, VLC *table, int flag) ...@@ -367,6 +367,8 @@ static int qdmc_get_vlc(GetBitContext *gb, VLC *table, int flag)
{ {
int v; int v;
if (get_bits_left(gb) < 1)
return AVERROR_INVALIDDATA;
v = get_vlc2(gb, table->table, table->bits, 1); v = get_vlc2(gb, table->table, table->bits, 1);
if (v < 0) if (v < 0)
return AVERROR_INVALIDDATA; return AVERROR_INVALIDDATA;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment