Fixed invalid writes in wavpack decoder on corrupted bitstreams.

Signed-off-by: Martin Storsjö <martin@martin.st>
(cherry picked from commit 0aedab0340)
This commit is contained in:
Laurent Aimar
2011-09-07 22:17:39 +02:00
committed by Michael Niedermayer
parent 90edd5df3d
commit 399f7e0e75

View File

@@ -1113,7 +1113,7 @@ static int wavpack_decode_block(AVCodecContext *avctx, int block_no,
int16_t *dst = (int16_t*)samples + 1;
int16_t *src = (int16_t*)samples;
int cnt = samplecount;
while(cnt--){
while(cnt-- > 0){
*dst = *src;
src += channel_stride;
dst += channel_stride;
@@ -1122,7 +1122,7 @@ static int wavpack_decode_block(AVCodecContext *avctx, int block_no,
int32_t *dst = (int32_t*)samples + 1;
int32_t *src = (int32_t*)samples;
int cnt = samplecount;
while(cnt--){
while(cnt-- > 0){
*dst = *src;
src += channel_stride;
dst += channel_stride;
@@ -1131,7 +1131,7 @@ static int wavpack_decode_block(AVCodecContext *avctx, int block_no,
float *dst = (float*)samples + 1;
float *src = (float*)samples;
int cnt = samplecount;
while(cnt--){
while(cnt-- > 0){
*dst = *src;
src += channel_stride;
dst += channel_stride;