]> git.sesse.net Git - ffmpeg/commitdiff
avfilter/vf_aspect: Fix integer overflow in compute_dar()
authorMichael Niedermayer <michael@niedermayer.cc>
Sat, 15 Feb 2020 21:35:37 +0000 (22:35 +0100)
committerMichael Niedermayer <michael@niedermayer.cc>
Sun, 16 Feb 2020 14:13:10 +0000 (15:13 +0100)
Fixes: signed integer overflow: 1562273630 * 17 cannot be represented in type 'int'
Fixes: Ticket8323
Found-by: Suhwan
Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
libavfilter/vf_aspect.c

index c042698ef7acc5cd3d7f72a2b38f2219e622431f..70e7fedc9767450820562a3cc6386260691d7543 100644 (file)
@@ -78,7 +78,7 @@ static int filter_frame(AVFilterLink *link, AVFrame *frame)
 static inline void compute_dar(AVRational *dar, AVRational sar, int w, int h)
 {
     if (sar.num && sar.den) {
-        av_reduce(&dar->num, &dar->den, sar.num * w, sar.den * h, INT_MAX);
+        av_reduce(&dar->num, &dar->den, sar.num * (int64_t)w, sar.den * (int64_t)h, INT_MAX);
     } else {
         av_reduce(&dar->num, &dar->den, w, h, INT_MAX);
     }