diff options
author | Luca Barbato <lu_zero@gentoo.org> | 2013-07-07 12:56:12 +0200 |
---|---|---|
committer | Luca Barbato <lu_zero@gentoo.org> | 2013-07-09 10:49:29 +0200 |
commit | 12576afe206d35231ccd61f9033c5fdab6a11e80 (patch) | |
tree | c727bd8d41b8604aa272b6f29e9fe94cd25cb54b /libavcodec/adpcm.c | |
parent | bbf6a4aa20bfe3d7869b2218e66063602dfb8aa7 (diff) | |
download | ffmpeg-12576afe206d35231ccd61f9033c5fdab6a11e80.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
Diffstat (limited to 'libavcodec/adpcm.c')
-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 950284946e..8b203218d1 100644 --- a/libavcodec/adpcm.c +++ b/libavcodec/adpcm.c @@ -770,7 +770,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); |