avcodec/snow: Fix runtime error: signed integer overflow: 1086573993 + 1086573994...
authorMichael Niedermayer <michael@niedermayer.cc>
Sun, 28 May 2017 15:12:35 +0000 (17:12 +0200)
committerMichael Niedermayer <michael@niedermayer.cc>
Sun, 28 May 2017 15:13:07 +0000 (17:13 +0200)
Fixes: 1871/clusterfuzz-testcase-minimized-5719950331215872

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
libavcodec/snow.h

index 59c710b..f7ed1f8 100644 (file)
@@ -540,7 +540,8 @@ static inline int get_symbol(RangeCoder *c, uint8_t *state, int is_signed){
     if(get_rac(c, state+0))
         return 0;
     else{
-        int i, e, a;
+        int i, e;
+        unsigned a;
         e= 0;
         while(get_rac(c, state+1 + FFMIN(e,9))){ //1..10
             e++;