summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <[email protected]>2019-11-12 18:39:08 +0100
committerMichael Niedermayer <[email protected]>2020-07-01 13:33:43 +0200
commit724e1f89b623b43006f92c8275dc247d582f2936 (patch)
treeb6b06dd85080658dd5c43592a4a4875a5c185bed
parent027fd7079f9ac90511544a756ad235c9287315dc (diff)
avcodec/wmaprodec: Check if the channel sum of all internal contexts match the external
Fixes: NULL pointer dereference Fixes: 18689/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_XMA1_fuzzer-5715114640015360 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <[email protected]> (cherry picked from commit 090ac5799751c6f52358da4e5201a3845760db93) Signed-off-by: Michael Niedermayer <[email protected]>
-rw-r--r--libavcodec/wmaprodec.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/libavcodec/wmaprodec.c b/libavcodec/wmaprodec.c
index b3960c2761..c8ae9608ff 100644
--- a/libavcodec/wmaprodec.c
+++ b/libavcodec/wmaprodec.c
@@ -1899,6 +1899,8 @@ static av_cold int xma_decode_init(AVCodecContext *avctx)
s->start_channel[i] = start_channels;
start_channels += s->xma[i].nb_channels;
}
+ if (start_channels != avctx->channels)
+ return AVERROR_INVALIDDATA;
return ret;
}