avcodec/rv34: Fix runtime error: signed integer overflow: 36880 * 66288 cannot be...
authorMichael Niedermayer <michael@niedermayer.cc>
Sun, 12 Mar 2017 02:04:05 +0000 (03:04 +0100)
committerMichael Niedermayer <michael@niedermayer.cc>
Mon, 13 Mar 2017 03:48:43 +0000 (04:48 +0100)
Fixes: 768/clusterfuzz-testcase-4807444305805312

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

index be49804..d2d676a 100644 (file)
@@ -1636,7 +1636,7 @@ static AVRational update_sar(int old_w, int old_h, AVRational sar, int new_w, in
     if (!sar.num)
         sar = (AVRational){1, 1};
 
-    sar = av_mul_q(sar, (AVRational){new_h * old_w, new_w * old_h});
+    sar = av_mul_q(sar, av_mul_q((AVRational){new_h, new_w}, (AVRational){old_w, old_h}));
     return sar;
 }