diff options
author | Luca Barbato <lu_zero@gentoo.org> | 2013-07-07 12:56:12 +0200 |
---|---|---|
committer | Luca Barbato <lu_zero@gentoo.org> | 2013-09-13 15:50:41 +0200 |
commit | b9dea1a085c4705e480bd17dfa8c8ce227fdce76 (patch) | |
tree | 10815acc55018229f1d14d09527b09debce8801f /libavcodec | |
parent | 90acd3bfe7fa8d4c92712d40e284c15d95ce5005 (diff) | |
download | ffmpeg-b9dea1a085c4705e480bd17dfa8c8ce227fdce76.tar.gz |
adpcm: Write the correct number of samples for ima-dk4
Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
(cherry picked from commit 12576afe206d35231ccd61f9033c5fdab6a11e80)
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
Conflicts:
libavcodec/adpcm.c
Diffstat (limited to 'libavcodec')
-rw-r--r-- | libavcodec/adpcm.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/libavcodec/adpcm.c b/libavcodec/adpcm.c index a2947329eb..476315c610 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); |