diff options
author | Laurent Aimar <fenrir@videolan.org> | 2011-09-07 22:17:39 +0200 |
---|---|---|
committer | Martin Storsjö <martin@martin.st> | 2011-09-08 12:00:13 +0300 |
commit | 0aedab03405849962b469277afe047aa2c61a87f (patch) | |
tree | 17bb9b9ece8baa085f3a4ca99162c65f551a2ccb /libavcodec | |
parent | beefafda639dd53fc59c21d8a7cf8334da9a1062 (diff) | |
download | ffmpeg-streaming-0aedab03405849962b469277afe047aa2c61a87f.zip ffmpeg-streaming-0aedab03405849962b469277afe047aa2c61a87f.tar.gz |
Fixed invalid writes in wavpack decoder on corrupted bitstreams.
Signed-off-by: Martin Storsjö <martin@martin.st>
Diffstat (limited to 'libavcodec')
-rw-r--r-- | libavcodec/wavpack.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/libavcodec/wavpack.c b/libavcodec/wavpack.c index fccafa8..41a1176 100644 --- a/libavcodec/wavpack.c +++ b/libavcodec/wavpack.c @@ -1114,7 +1114,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; @@ -1123,7 +1123,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; @@ -1132,7 +1132,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; |