[FFmpeg-devel] [PATCH v2] avfilter/scale: fix CID 1457833
Gyan Doshi
ffmpeg at gyani.pro
Fri Jan 31 09:16:13 EET 2020
Remove expressions with constant results and
improve overflow checks.
---
libavfilter/vf_scale.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/libavfilter/vf_scale.c b/libavfilter/vf_scale.c
index 0348f19d33..b6c6414258 100644
--- a/libavfilter/vf_scale.c
+++ b/libavfilter/vf_scale.c
@@ -497,10 +497,8 @@ static int config_props(AVFilterLink *outlink)
scale->force_original_aspect_ratio,
scale->force_divisible_by);
- if (scale->w > INT_MAX ||
- scale->h > INT_MAX ||
- (scale->h * inlink->w) > INT_MAX ||
- (scale->w * inlink->h) > INT_MAX)
+ if ((scale->h > INT_MAX / inlink->w) ||
+ (scale->w > INT_MAX / inlink->h))
av_log(ctx, AV_LOG_ERROR, "Rescaled value for width or height is too big.\n");
outlink->w = scale->w;
--
2.24.1
More information about the ffmpeg-devel
mailing list