diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2011-09-13 23:24:56 +0200 |
---|---|---|
committer | Martin Storsjö <martin@martin.st> | 2011-09-14 11:13:54 +0300 |
commit | 5166376f24545207607f61ed8ff4e1b0572ff320 (patch) | |
tree | 4793b915503b3a454ef2ca0551ee556951eec586 /libavcodec/smacker.c | |
parent | 6489455495fc5bfbebcfe3f57e5d4fdd6a781091 (diff) | |
download | ffmpeg-5166376f24545207607f61ed8ff4e1b0572ff320.tar.gz |
smacker: fix a few off by 1 errors
stereo & 16bit is untested due to lack of samples
Signed-off-by: Martin Storsjö <martin@martin.st>
Diffstat (limited to 'libavcodec/smacker.c')
-rw-r--r-- | libavcodec/smacker.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/libavcodec/smacker.c b/libavcodec/smacker.c index a841b6cde6..496bbb5624 100644 --- a/libavcodec/smacker.c +++ b/libavcodec/smacker.c @@ -624,9 +624,9 @@ static int smka_decode_frame(AVCodecContext *avctx, void *data, int *data_size, if(bits) { //decode 16-bit data for(i = stereo; i >= 0; i--) pred[i] = av_bswap16(get_bits(&gb, 16)); - for(i = 0; i < stereo; i++) + for(i = 0; i <= stereo; i++) *samples++ = pred[i]; - for(i = 0; i < unp_size / 2; i++) { + for(; i < unp_size / 2; i++) { if(i & stereo) { if(vlc[2].table) res = get_vlc2(&gb, vlc[2].table, SMKTREE_BITS, 3); @@ -658,9 +658,9 @@ static int smka_decode_frame(AVCodecContext *avctx, void *data, int *data_size, } else { //8-bit data for(i = stereo; i >= 0; i--) pred[i] = get_bits(&gb, 8); - for(i = 0; i < stereo; i++) + for(i = 0; i <= stereo; i++) *samples8++ = pred[i]; - for(i = 0; i < unp_size; i++) { + for(; i < unp_size; i++) { if(i & stereo){ if(vlc[1].table) res = get_vlc2(&gb, vlc[1].table, SMKTREE_BITS, 3); |