ffmpeg | branch: release/4.3 | Michael Niedermayer <mich...@niedermayer.cc> | 
Tue Jun 30 21:32:53 2020 +0200| [d25345bb006c8ba757eb3608bb55d18f5ae84c53] | 
committer: Michael Niedermayer

avcodec/hcadec: Check total_band_count against imdct_in size

Fixes: index 128 out of bounds for type 'float [128]'
Fixes: 
23465/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_HCA_fuzzer-5089866596745216

Found-by: continuous fuzzing process 
https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <mich...@niedermayer.cc>
(cherry picked from commit 2d96c945312d3f62e3f872bfb51a593afb40e09a)
Signed-off-by: Michael Niedermayer <mich...@niedermayer.cc>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=d25345bb006c8ba757eb3608bb55d18f5ae84c53
---

 libavcodec/hcadec.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/libavcodec/hcadec.c b/libavcodec/hcadec.c
index 5fa87319d2..f46ed699d1 100644
--- a/libavcodec/hcadec.c
+++ b/libavcodec/hcadec.c
@@ -157,6 +157,10 @@ static av_cold int decode_init(AVCodecContext *avctx)
     } else
         return AVERROR_INVALIDDATA;
 
+    if (c->total_band_count > FF_ARRAY_ELEMS(c->ch->imdct_in))
+        return AVERROR_INVALIDDATA;
+
+
     while (get_bits_left(gb) >= 32) {
         chunk = get_bits_long(gb, 32);
         if (chunk == MKBETAG('v', 'b', 'r', 0)) {

_______________________________________________
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog

To unsubscribe, visit link above, or email
ffmpeg-cvslog-requ...@ffmpeg.org with subject "unsubscribe".

Reply via email to