aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec
diff options
context:
space:
mode:
authorLuca Barbato <lu_zero@gentoo.org>2013-07-07 12:56:12 +0200
committerLuca Barbato <lu_zero@gentoo.org>2013-08-24 11:33:21 +0200
commitc02d4c1a98aef485be25228b33adb4ce357173e4 (patch)
tree7ee352c9dde08abfbf90d75c611bbc2f5e14b885 /libavcodec
parent6d2a92c4678616fe342be0b606343ae3ade83641 (diff)
downloadffmpeg-c02d4c1a98aef485be25228b33adb4ce357173e4.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>
Diffstat (limited to 'libavcodec')
-rw-r--r--libavcodec/adpcm.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libavcodec/adpcm.c b/libavcodec/adpcm.c
index 3b0eb8b9d0..df6b9d300f 100644
--- a/libavcodec/adpcm.c
+++ b/libavcodec/adpcm.c
@@ -773,7 +773,7 @@ static int adpcm_decode_frame(AVCodecContext *avctx, void *data,
return AVERROR_INVALIDDATA;
}
}
- for (n = nb_samples >> (1 - st); n > 0; n--) {
+ for (n = (nb_samples >> (1 - st)) - 1; n > 0; n--) {
int v = bytestream2_get_byteu(&gb);
*samples++ = adpcm_ima_expand_nibble(&c->status[0 ], v >> 4 , 3);
*samples++ = adpcm_ima_expand_nibble(&c->status[st], v & 0x0F, 3);