diff options
author | Michael Niedermayer <michael@niedermayer.cc> | 2018-08-20 22:53:32 +0200 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2018-11-01 00:52:46 +0100 |
commit | 66331499a7d221d5053f74452c976b2d8f2038f6 (patch) | |
tree | 044ab5a8f4cd56a29f1d4b2a0f9ea63940e3f1d2 | |
parent | 347c50b0d4e7119e77edcd0871b5d9c841877af4 (diff) | |
download | ffmpeg-66331499a7d221d5053f74452c976b2d8f2038f6.tar.gz |
avcodec/hq_hqa: Check remaining input bits in hqa_decode_mb()
Fixes: Timeout
Fixes: 9634/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_HQ_HQA_fuzzer-6267852259590144
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit c9222b972d6cbdaf6571cf7ae0a6513bffa5ff9f)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r-- | libavcodec/hq_hqa.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/libavcodec/hq_hqa.c b/libavcodec/hq_hqa.c index f88ad7d5f5..ec9da3e04f 100644 --- a/libavcodec/hq_hqa.c +++ b/libavcodec/hq_hqa.c @@ -181,6 +181,9 @@ static int hqa_decode_mb(HQContext *c, AVFrame *pic, int qgroup, int flag = 0; int i, ret, cbp; + if (get_bits_left(gb) < 1) + return AVERROR_INVALIDDATA; + cbp = get_vlc2(gb, c->hqa_cbp_vlc.table, 5, 1); for (i = 0; i < 12; i++) |