[FFmpeg-cvslog] adpcm: Write the correct number of samples for ima-dk4

Luca Barbato git at videolan.org
Sun Sep 22 13:28:53 CEST 2013


ffmpeg | branch: release/0.10 | Luca Barbato <lu_zero at gentoo.org> | Sun Jul  7 12:56:12 2013 +0200| [b9dea1a085c4705e480bd17dfa8c8ce227fdce76] | committer: Luca Barbato

adpcm: Write the correct number of samples for ima-dk4

Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable at libav.org
(cherry picked from commit 12576afe206d35231ccd61f9033c5fdab6a11e80)

Signed-off-by: Luca Barbato <lu_zero at gentoo.org>

Conflicts:
	libavcodec/adpcm.c

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

 libavcodec/adpcm.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavcodec/adpcm.c b/libavcodec/adpcm.c
index a294732..476315c 100644
--- a/libavcodec/adpcm.c
+++ b/libavcodec/adpcm.c
@@ -708,7 +708,7 @@ static int adpcm_decode_frame(AVCodecContext *avctx, void *data,
             src++;
             *samples++ = cs->predictor;
         }
-        for (n = nb_samples >> (1 - st); n > 0; n--, src++) {
+        for (n = (nb_samples >> (1 - st)) - 1; n > 0; n--) {
             uint8_t v = *src;
             *samples++ = adpcm_ima_expand_nibble(&c->status[0 ], v >> 4  , 3);
             *samples++ = adpcm_ima_expand_nibble(&c->status[st], v & 0x0F, 3);



More information about the ffmpeg-cvslog mailing list