aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2019-11-12 18:39:08 +0100
committerMichael Niedermayer <michael@niedermayer.cc>2020-07-02 19:55:08 +0200
commit63bad93076218af1b0dd3248f6b9149b0ebe7f47 (patch)
treef065bf1abd0837efbdafb48002f8ae04be0b94ac
parenta1a6336a586ecf3c7d3486138dfc64afe9453980 (diff)
downloadffmpeg-63bad93076218af1b0dd3248f6b9149b0ebe7f47.tar.gz
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 <michael@niedermayer.cc> (cherry picked from commit 090ac5799751c6f52358da4e5201a3845760db93) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r--libavcodec/wmaprodec.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/libavcodec/wmaprodec.c b/libavcodec/wmaprodec.c
index 4cff07adf8..327db9335d 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;
}