avcodec/mss3: Fix runtime error: signed integer overflow: -2146318336 - 2139696256...
authorMichael Niedermayer <michael@niedermayer.cc>
Thu, 11 May 2017 21:06:50 +0000 (23:06 +0200)
committerMichael Niedermayer <michael@niedermayer.cc>
Thu, 11 May 2017 21:55:59 +0000 (23:55 +0200)
Fix is similar to rac_get_model_sym()
Fixes: 1483/clusterfuzz-testcase-minimized-6386507814273024
Fixes: 1485/clusterfuzz-testcase-minimized-6639880215986176

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

index 81b7e20..21226f9 100644 (file)
@@ -389,9 +389,10 @@ static int rac_get_model_sym(RangeCoder *c, Model *m)
 
 static int rac_get_model256_sym(RangeCoder *c, Model256 *m)
 {
-    int prob, prob2, helper, val;
+    int val;
     int start, end;
     int ssym;
+    unsigned prob, prob2, helper;
 
     prob2      = c->range;
     c->range >>= MODEL_SCALE;