Module: libav
Branch: release/0.6
Commit: 9864518544f85ca8f0c2764fd66d728c47652bcc

Author:    Laurent Aimar <[email protected]>
Committer: Reinhard Tartler <[email protected]>
Date:      Wed Sep  7 23:12:32 2011 +0200

Fixed invalid access in wavpack decoder on corrupted extra bits sub-blocks.

Signed-off-by: Martin Storsjö <[email protected]>
(cherry picked from commit beefafda639dd53fc59c21d8a7cf8334da9a1062)

Signed-off-by: Anton Khirnov <[email protected]>
Signed-off-by: Reinhard Tartler <[email protected]>

---

 libavcodec/wavpack.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/libavcodec/wavpack.c b/libavcodec/wavpack.c
index 7358d29..3963a60 100644
--- a/libavcodec/wavpack.c
+++ b/libavcodec/wavpack.c
@@ -368,7 +368,7 @@ static inline int wv_get_value_integer(WavpackContext *s, 
uint32_t *crc, int S)
     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);
         }

_______________________________________________
libav-commits mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-commits

Reply via email to