Browse Source

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/ffmpeg
Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 2c7975fe6f)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
tags/n4.0.5
Michael Niedermayer 6 years ago
parent
commit
0cdd0486ef
1 changed files with 2 additions and 0 deletions
  1. +2
    -0
      libavcodec/qdmc.c

+ 2
- 0
libavcodec/qdmc.c View File

@@ -365,6 +365,8 @@ static int qdmc_get_vlc(GetBitContext *gb, VLC *table, int flag)
{
int v;

if (get_bits_left(gb) < 1)
return AVERROR_INVALIDDATA;
v = get_vlc2(gb, table->table, table->bits, 1);
if (v < 0)
return AVERROR_INVALIDDATA;


Loading…
Cancel
Save