aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Niedermayer2019-11-12 18:39:08 +0100
committerMichael Niedermayer2019-12-31 19:51:57 +0100
commit7bf4d235c0c96668c27a890c5d891a94afc52480 (patch)
tree247217790c9e4df5df4e2872bd30bf1a1fc810a5
parent3bd30882b1d50e45cbb97e754b361982dfc81e8e (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 <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 87e2ead693..6a22e2f552 100644
--- a/libavcodec/wmaprodec.c
+++ b/libavcodec/wmaprodec.c
@@ -1930,6 +1930,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;
}