Re: [FFmpeg-devel] [PATCH 1/4] avcodec/rv10: Fix integer overflow in aspect ratio compare

2019-07-08 Thread Michael Niedermayer
On Fri, Jun 28, 2019 at 10:53:42PM +0200, Michael Niedermayer wrote:
> Fixes: signed integer overflow: 2040 * 1187872 cannot be represented in type 
> 'int'
> Fixes: 
> 15368/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_RV20_fuzzer-5681657136283648
> 
> Found-by: continuous fuzzing process 
> https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
> Signed-off-by: Michael Niedermayer 
> ---
>  libavcodec/rv10.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)

will apply

[...]
-- 
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Opposition brings concord. Out of discord comes the fairest harmony.
-- Heraclitus


signature.asc
Description: PGP signature
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".

[FFmpeg-devel] [PATCH 1/4] avcodec/rv10: Fix integer overflow in aspect ratio compare

2019-06-28 Thread Michael Niedermayer
Fixes: signed integer overflow: 2040 * 1187872 cannot be represented in type 
'int'
Fixes: 
15368/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_RV20_fuzzer-5681657136283648

Found-by: continuous fuzzing process 
https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer 
---
 libavcodec/rv10.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/libavcodec/rv10.c b/libavcodec/rv10.c
index 8f4497b9e0..729e4a8d2c 100644
--- a/libavcodec/rv10.c
+++ b/libavcodec/rv10.c
@@ -388,9 +388,9 @@ static int rv20_decode_picture_header(RVDecContext *rv)
 // attempt to keep aspect during typical resolution switches
 if (!old_aspect.num)
 old_aspect = (AVRational){1, 1};
-if (2 * new_w * s->height == new_h * s->width)
+if (2 * (int64_t)new_w * s->height == (int64_t)new_h * s->width)
 s->avctx->sample_aspect_ratio = av_mul_q(old_aspect, 
(AVRational){2, 1});
-if (new_w * s->height == 2 * new_h * s->width)
+if ((int64_t)new_w * s->height == 2 * (int64_t)new_h * s->width)
 s->avctx->sample_aspect_ratio = av_mul_q(old_aspect, 
(AVRational){1, 2});
 
 ret = ff_set_dimensions(s->avctx, new_w, new_h);
-- 
2.22.0

___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".