aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2019-10-12 18:32:08 +0200
committerMichael Niedermayer <michael@niedermayer.cc>2019-11-15 12:25:46 +0100
commit25a917e46f798350460df75e35cf87c07bff83b9 (patch)
treed47e5e0b7170c4e59cd9b44e5b9be88cec9325df
parent34905f72198b59f4a2bb2f54c24d5c04b7414828 (diff)
downloadffmpeg-25a917e46f798350460df75e35cf87c07bff83b9.tar.gz
avcodec/wmaprodec: Check that the streams channels do not exceed the overall channels
Fixes: NULL pointer dereference Fixes: 18075/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_XMA1_fuzzer-5708262036471808 Fixes: 18087/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_XMA1_fuzzer-5740627634946048 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Reviewed-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc> (cherry picked from commit e418b315ddd0505e707860f8cc8b796ce06f3458) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r--libavcodec/wmaprodec.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libavcodec/wmaprodec.c b/libavcodec/wmaprodec.c
index 526e94ba5d..fc96278512 100644
--- a/libavcodec/wmaprodec.c
+++ b/libavcodec/wmaprodec.c
@@ -436,7 +436,7 @@ static av_cold int decode_init(WMAProDecodeCtx *s, AVCodecContext *avctx, int nu
av_log(avctx, AV_LOG_ERROR, "invalid number of channels per XMA stream %d\n",
s->nb_channels);
return AVERROR_INVALIDDATA;
- } else if (s->nb_channels > WMAPRO_MAX_CHANNELS) {
+ } else if (s->nb_channels > WMAPRO_MAX_CHANNELS || s->nb_channels > avctx->channels) {
avpriv_request_sample(avctx,
"More than %d channels", WMAPRO_MAX_CHANNELS);
return AVERROR_PATCHWELCOME;