[FFmpeg-cvslog] avcodec/cbs_jpeg_syntax_template: Check table index before use in dht()
Michael Niedermayer
git at videolan.org
Wed Apr 15 20:02:25 EEST 2020
ffmpeg | branch: master | Michael Niedermayer <michael at niedermayer.cc> | Sun Apr 12 21:38:55 2020 +0200| [d31862c2b1b1fd07dcdc503193056d6c9ad28ccb] | committer: Michael Niedermayer
avcodec/cbs_jpeg_syntax_template: Check table index before use in dht()
Fixes: out of array access
Fixes: 21515/clusterfuzz-testcase-minimized-ffmpeg_BSF_TRACE_HEADERS_fuzzer-5766121576988672
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=d31862c2b1b1fd07dcdc503193056d6c9ad28ccb
---
libavcodec/cbs_jpeg_syntax_template.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/libavcodec/cbs_jpeg_syntax_template.c b/libavcodec/cbs_jpeg_syntax_template.c
index d3cd9ff62e..1ffb77d231 100644
--- a/libavcodec/cbs_jpeg_syntax_template.c
+++ b/libavcodec/cbs_jpeg_syntax_template.c
@@ -108,6 +108,9 @@ static int FUNC(dht)(CodedBitstreamContext *ctx, RWContext *rw,
n = 2;
for (i = 0; n < current->Lh; i++) {
+ if (i >= 8)
+ return AVERROR_INVALIDDATA;
+
CHECK(FUNC(huffman_table)(ctx, rw, ¤t->table[i]));
++n;
More information about the ffmpeg-cvslog
mailing list