Browse code

avcodec/cabac_functions: Fix "left shift of negative value -31767"

Fixes: 1430e9c43fae47a24c179c7c54f94918/signal_sigsegv_421427_2340_591e9810c7b09efe501ad84638c9e9f8.264

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Found-by: xiedingbao (Ticket4727)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit a1f6b05f5228979dab0e149deca7a30d22e98af5)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>

Michael Niedermayer authored on 2015/11/27 20:11:29
Showing 1 changed files
... ...
@@ -74,7 +74,8 @@ static inline void renorm_cabac_decoder_once(CABACContext *c){
74 74
 
75 75
 #ifndef get_cabac_inline
76 76
 static void refill2(CABACContext *c){
77
-    int i, x;
77
+    int i;
78
+    unsigned x;
78 79
 
79 80
     x= c->low ^ (c->low-1);
80 81
     i= 7 - ff_h264_norm_shift[x>>(CABAC_BITS-1)];