diff options
author | Justin Ruggles <justin.ruggles@gmail.com> | 2011-10-02 15:58:54 -0400 |
---|---|---|
committer | Justin Ruggles <justin.ruggles@gmail.com> | 2011-10-14 15:53:41 -0400 |
commit | ff5790c76102ef2574e94c77edf2d7e81eb40752 (patch) | |
tree | b5bf26fb53877118a56b0951478faa57e7571397 /libavcodec/adpcm.c | |
parent | 8140a1288ff2498adcbb67db73ef9862b518bb88 (diff) | |
download | ffmpeg-ff5790c76102ef2574e94c77edf2d7e81eb40752.tar.gz |
adpcmdec: do not terminate early in ADPCM IMA Duck DK3 decoder.
There are still 2 nibbles to decode once the last byte in the packet has been
read. Updated FATE reference.
Diffstat (limited to 'libavcodec/adpcm.c')
-rw-r--r-- | libavcodec/adpcm.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/libavcodec/adpcm.c b/libavcodec/adpcm.c index 8ab3bd8954..200957b26c 100644 --- a/libavcodec/adpcm.c +++ b/libavcodec/adpcm.c @@ -325,8 +325,11 @@ static void xa_decode(short *out, const unsigned char *in, } \ else \ { \ + if (end_of_packet) \ + break; \ last_byte = *src++; \ - if (src >= buf + buf_size) break; \ + if (src >= buf + buf_size) \ + end_of_packet = 1; \ nibble = last_byte & 0x0F; \ decode_top_nibble_next = 1; \ } @@ -534,6 +537,7 @@ static int adpcm_decode_frame(AVCodecContext *avctx, unsigned char last_byte = 0; unsigned char nibble; int decode_top_nibble_next = 0; + int end_of_packet = 0; int diff_channel; if (avctx->block_align != 0 && buf_size > avctx->block_align) |