1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-12-23 12:43:46 +02:00

avfilter/vf_aspect: Fix integer overflow in compute_dar()

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>
This commit is contained in:
Michael Niedermayer 2020-02-15 22:35:37 +01:00
parent 96840e47de
commit 0c0ca0f244

View 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) static inline void compute_dar(AVRational *dar, AVRational sar, int w, int h)
{ {
if (sar.num && sar.den) { 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 { } else {
av_reduce(&dar->num, &dar->den, w, h, INT_MAX); av_reduce(&dar->num, &dar->den, w, h, INT_MAX);
} }