diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2011-12-19 04:09:23 +0100 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2012-01-03 19:49:55 +0100 |
commit | 25cadd366bce02e3d1fc070ee6dd9f208e2b11c9 (patch) | |
tree | b230a76eed38d8916063274849469576be819766 | |
parent | f57c629b18cb0eebbb1203149390943c465acd9d (diff) | |
download | ffmpeg-25cadd366bce02e3d1fc070ee6dd9f208e2b11c9.tar.gz |
adpcm: Fix crash
Fixes half of Ticket794
Bug found by: Oana Stratulat
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 608708009f69ba4cecebf05120c696167494c897)
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r-- | libavcodec/adpcm.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/libavcodec/adpcm.c b/libavcodec/adpcm.c index bbc7d1cd27..e7657945dd 100644 --- a/libavcodec/adpcm.c +++ b/libavcodec/adpcm.c @@ -818,6 +818,9 @@ static int adpcm_decode_frame(AVCodecContext *avctx, void *data, /* Each EA ADPCM frame has a 12-byte header followed by 30-byte pieces, each coding 28 stereo samples. */ + if(avctx->channels != 2) + return AVERROR_INVALIDDATA; + src += 4; // skip sample count (already read) current_left_sample = (int16_t)bytestream_get_le16(&src); |