]> git.sesse.net Git - ffmpeg/commitdiff
avcodec/atrac9dec: Check q_unit_cnt in parse_band_ext()
authorMichael Niedermayer <michael@niedermayer.cc>
Sun, 16 Jun 2019 19:01:50 +0000 (21:01 +0200)
committerMichael Niedermayer <michael@niedermayer.cc>
Sat, 29 Jun 2019 17:22:19 +0000 (19:22 +0200)
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 <michael@niedermayer.cc>
libavcodec/atrac9dec.c

index 08fe483e39a89bfd078e89e07aeb02ea4d639473..4d490daeb0fa534efa01cd92482b67a2b8818a77 100644 (file)
@@ -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);