diff mbox

[FFmpeg-devel,2/3] avcodec/rv34: Fix runtime error: signed integer overflow: 36880 * 66288 cannot be represented in type 'int'

Message ID 20170312020406.18387-2-michael@niedermayer.cc
State Accepted
Commit a66c6e28b543804f50df1c6083a204219b6b1daa
Headers show

Commit Message

Michael Niedermayer March 12, 2017, 2:04 a.m. UTC
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 | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Michael Niedermayer March 13, 2017, 3:49 a.m. UTC | #1
On Sun, Mar 12, 2017 at 03:04:05AM +0100, Michael Niedermayer wrote:
> 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 | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

applied

[...]
diff mbox

Patch

diff --git a/libavcodec/rv34.c b/libavcodec/rv34.c
index be49804ebd..d2d676a86d 100644
--- a/libavcodec/rv34.c
+++ b/libavcodec/rv34.c
@@ -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;
 }