[FFmpeg-cvslog] avcodec/vc1_block: Check get_vlc2() return before use
Michael Niedermayer
git at videolan.org
Mon Aug 5 20:50:17 EEST 2019
ffmpeg | branch: release/4.2 | Michael Niedermayer <michael at niedermayer.cc> | Sun Aug 4 08:32:58 2019 +0200| [889fdc690a3ff0166e24e3c6403bbd320041094a] | committer: Michael Niedermayer
avcodec/vc1_block: Check get_vlc2() return before use
Fixes: index -1 out of bounds for type 'const uint8_t [185][2]'
Fixes: 15720/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_MSS2_fuzzer-5666071933091840
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>
(cherry picked from commit 2cb1f797350875ec45cb20d59dc0684fcbac20fc)
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=889fdc690a3ff0166e24e3c6403bbd320041094a
---
libavcodec/vc1_block.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/libavcodec/vc1_block.c b/libavcodec/vc1_block.c
index eda0b28964..97c873f138 100644
--- a/libavcodec/vc1_block.c
+++ b/libavcodec/vc1_block.c
@@ -526,6 +526,8 @@ static int vc1_decode_ac_coeff(VC1Context *v, int *last, int *skip,
int escape = decode210(gb);
if (escape != 2) {
index = get_vlc2(gb, ff_vc1_ac_coeff_table[codingset].table, AC_VLC_BITS, 3);
+ if (index < 0)
+ return AVERROR_INVALIDDATA;
run = vc1_index_decode_table[codingset][index][0];
level = vc1_index_decode_table[codingset][index][1];
lst = index >= vc1_last_decode_table[codingset];
More information about the ffmpeg-cvslog
mailing list