aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2019-09-23 23:52:04 +0200
committerMichael Niedermayer <michael@niedermayer.cc>2019-11-11 20:18:47 +0100
commit59f5d232dccf5da8d64b16bccdffc480f509be27 (patch)
tree6a2d26704ca36afb3ba2cc58148efa045a0a634c
parentd918e45760a2637e0e8947466ec6688030a3e084 (diff)
downloadffmpeg-59f5d232dccf5da8d64b16bccdffc480f509be27.tar.gz
avcodec/adpcm: Check number of channels for MTAF
Fixes: out of array access Fixes: 17608/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_ADPCM_MTAF_fuzzer-5074936267276288 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 74bbf9bc8279e0b8eba89c8cca68e8ad7ff547ed) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r--libavcodec/adpcm.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/libavcodec/adpcm.c b/libavcodec/adpcm.c
index cd3bbd33c2..b0f8c11cb5 100644
--- a/libavcodec/adpcm.c
+++ b/libavcodec/adpcm.c
@@ -110,6 +110,10 @@ static av_cold int adpcm_decode_init(AVCodecContext * avctx)
case AV_CODEC_ID_ADPCM_MTAF:
min_channels = 2;
max_channels = 8;
+ if (avctx->channels & 1) {
+ avpriv_request_sample(avctx, "channel count %d\n", avctx->channels);
+ return AVERROR_PATCHWELCOME;
+ }
break;
case AV_CODEC_ID_ADPCM_PSX:
max_channels = 8;