summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2019-06-16 21:01:50 +0200
committerMichael Niedermayer <michael@niedermayer.cc>2019-06-29 19:22:19 +0200
commitfb4a4557d15bce601e2462207648741600fa273f (patch)
tree7e4ae448777f2b51ded21cf0db219fce5fa5d7a3
parentac9af7e9a5befa8a554bacbcc59ab2f11203d85e (diff)
downloadffmpeg-streaming-fb4a4557d15bce601e2462207648741600fa273f.zip
ffmpeg-streaming-fb4a4557d15bce601e2462207648741600fa273f.tar.gz
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 <michael@niedermayer.cc>
-rw-r--r--libavcodec/atrac9dec.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/libavcodec/atrac9dec.c b/libavcodec/atrac9dec.c
index 08fe483..4d490da 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);
OpenPOWER on IntegriCloud