diff options
author | Laurent Aimar <fenrir@videolan.org> | 2011-09-07 22:17:39 +0200 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2011-09-21 17:57:33 +0200 |
commit | 558cf502acdb1743921a212804199d650deaeaeb (patch) | |
tree | 4d74828b810315cfb6878a3f3608f3e3fd2b0114 | |
parent | b0da6a744a4a3d089d9b5ea547e03336a1fe5f2c (diff) | |
download | ffmpeg-558cf502acdb1743921a212804199d650deaeaeb.tar.gz |
Fixed invalid writes in wavpack decoder on corrupted bitstreams.
Signed-off-by: Martin Storsjö <martin@martin.st>
(cherry picked from commit 0aedab03405849962b469277afe047aa2c61a87f)
-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 61a75fd765..1e6d857849 100644 --- a/libavcodec/wavpack.c +++ b/libavcodec/wavpack.c @@ -1141,7 +1141,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; @@ -1150,7 +1150,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; @@ -1159,7 +1159,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; |