ffmpeg | branch: release/4.1 | Michael Niedermayer <mich...@niedermayer.cc> | 
Sun Jun 16 21:01:50 2019 +0200| [7daa138f6819ef5ec65fd6af52aeb2ebb0ed9486] | 
committer: Michael Niedermayer

avcodec/atrac9dec: Check q_unit_cnt in parse_band_ext()

Fixes: global-buffer-overflow
Fixes: 
15247/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_ATRAC9_fuzzer-5671602181636096

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 fb4a4557d15bce601e2462207648741600fa273f)
Signed-off-by: Michael Niedermayer <mich...@niedermayer.cc>

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

 libavcodec/atrac9dec.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/libavcodec/atrac9dec.c b/libavcodec/atrac9dec.c
index 11b683d136..ff4991a573 100644
--- a/libavcodec/atrac9dec.c
+++ b/libavcodec/atrac9dec.c
@@ -202,6 +202,8 @@ static inline int parse_band_ext(ATRAC9Context *s, 
ATRAC9BlockData *b,
     int ext_band = 0;
 
     if (b->has_band_ext) {
+        if (b->q_unit_cnt < 13)
+            return AVERROR_INVALIDDATA;
         ext_band = at9_tab_band_ext_group[b->q_unit_cnt - 13][2];
         if (stereo) {
             b->channel[1].band_ext = get_bits(gb, 2);

_______________________________________________
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