aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/qdmc.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2019-10-10 18:26:44 +0200
committerMichael Niedermayer <michael@niedermayer.cc>2019-10-12 13:21:50 +0200
commit2c7975fe6f5c734fce9c59e8418c7f2de15a558d (patch)
tree12189179586e0c30e9d1be5be40230d2780c507d /libavcodec/qdmc.c
parentf76a899abc80512959ec7deab25bc9642c4feb73 (diff)
downloadffmpeg-2c7975fe6f5c734fce9c59e8418c7f2de15a558d.tar.gz
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>
Diffstat (limited to 'libavcodec/qdmc.c')
-rw-r--r--libavcodec/qdmc.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/libavcodec/qdmc.c b/libavcodec/qdmc.c
index 8bea1552e1..10ceb7aa55 100644
--- a/libavcodec/qdmc.c
+++ b/libavcodec/qdmc.c
@@ -367,6 +367,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;