[FFmpeg-cvslog] adpcmdec: check remaining buffer size before decoding next block in the

Justin Ruggles git at videolan.org
Sun Oct 16 04:20:36 CEST 2011


ffmpeg | branch: master | Justin Ruggles <justin.ruggles at gmail.com> | Sun Oct  2 16:07:55 2011 -0400| [439998e18bdbdabd010fd9ab676a7298b62bf53d] | committer: Justin Ruggles

adpcmdec: check remaining buffer size before decoding next block in the
ADPCM IMA WAV decoder.

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

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

diff --git a/libavcodec/adpcm.c b/libavcodec/adpcm.c
index 200957b..774193e 100644
--- a/libavcodec/adpcm.c
+++ b/libavcodec/adpcm.c
@@ -431,7 +431,7 @@ static int adpcm_decode_frame(AVCodecContext *avctx,
             if (*src++) av_log(avctx, AV_LOG_ERROR, "unused byte should be null but is %d!!\n", src[-1]); /* unused */
         }
 
-        while(src < buf + buf_size){
+        while (src <= buf + buf_size - (avctx->channels * 4)) {
             for (i = 0; i < avctx->channels; i++) {
                 cs = &c->status[i];
                 for (m = 0; m < 4; m++) {



More information about the ffmpeg-cvslog mailing list