[FFmpeg-cvslog] adpcm: Fix crash

Michael Niedermayer git at videolan.org
Mon Dec 19 04:23:59 CET 2011


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Mon Dec 19 04:09:23 2011 +0100| [608708009f69ba4cecebf05120c696167494c897] | committer: Michael Niedermayer

adpcm: Fix crash
Fixes half of Ticket794
Bug found by: Oana Stratulat

Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=608708009f69ba4cecebf05120c696167494c897
---

 libavcodec/adpcm.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/libavcodec/adpcm.c b/libavcodec/adpcm.c
index bbc7d1c..e765794 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);



More information about the ffmpeg-cvslog mailing list