avfilter/vf_scale: Check ff_scale_adjust_dimensions() for failure

Helps: CID1513722 Operands don't affect result

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
Michael Niedermayer 2024-07-08 22:42:44 +02:00
parent ad9df8bcfe
commit 2a8fb3c2cc
No known key found for this signature in database
GPG Key ID: B18E8928B3948D64
1 changed files with 4 additions and 1 deletions

View File

@ -638,10 +638,13 @@ static int config_props(AVFilterLink *outlink)
outlink->w = scale->w;
outlink->h = scale->h;
ff_scale_adjust_dimensions(inlink, &outlink->w, &outlink->h,
ret = ff_scale_adjust_dimensions(inlink, &outlink->w, &outlink->h,
scale->force_original_aspect_ratio,
scale->force_divisible_by);
if (ret < 0)
goto fail;
if (outlink->w > INT_MAX ||
outlink->h > INT_MAX ||
(outlink->h * inlink->w) > INT_MAX ||