diff options
author | Laurent Aimar <fenrir@videolan.org> | 2011-09-07 23:12:32 +0200 |
---|---|---|
committer | Martin Storsjö <martin@martin.st> | 2011-09-08 11:57:13 +0300 |
commit | beefafda639dd53fc59c21d8a7cf8334da9a1062 (patch) | |
tree | 57babb8d12b1705286b4ae2b23e119f47c229a43 /libavcodec | |
parent | 5ea091fb5a12dc0210b8efdf30b573b87e21652b (diff) | |
download | ffmpeg-streaming-beefafda639dd53fc59c21d8a7cf8334da9a1062.zip ffmpeg-streaming-beefafda639dd53fc59c21d8a7cf8334da9a1062.tar.gz |
Fixed invalid access in wavpack decoder on corrupted extra bits sub-blocks.
Signed-off-by: Martin Storsjö <martin@martin.st>
Diffstat (limited to 'libavcodec')
-rw-r--r-- | libavcodec/wavpack.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/libavcodec/wavpack.c b/libavcodec/wavpack.c index 22fab38..fccafa8 100644 --- a/libavcodec/wavpack.c +++ b/libavcodec/wavpack.c @@ -385,7 +385,7 @@ static inline int wv_get_value_integer(WavpackFrameContext *s, uint32_t *crc, in if(s->extra_bits){ S <<= s->extra_bits; - if(s->got_extra_bits){ + if(s->got_extra_bits && get_bits_left(&s->gb_extra_bits) >= s->extra_bits){ S |= get_bits(&s->gb_extra_bits, s->extra_bits); *crc = *crc * 9 + (S&0xffff) * 3 + ((unsigned)S>>16); } |