avfilter/vf_scale_vaapi: propagate ff_scale_adjust_dimensions() error
ff_scale_adjust_dimensions() can now return a negative error code when the evaluated output dimensions are non-positive. Check the return value and fail fast instead of continuing with the unadjusted result. Signed-off-by: Jun Zhao <barryjzhao@tencent.com>
This commit is contained in:
@@ -87,8 +87,11 @@ static int scale_vaapi_config_output(AVFilterLink *outlink)
|
||||
w_adj = inlink->sample_aspect_ratio.num ?
|
||||
(double)inlink->sample_aspect_ratio.num / inlink->sample_aspect_ratio.den : 1;
|
||||
|
||||
ff_scale_adjust_dimensions(inlink, &vpp_ctx->output_width, &vpp_ctx->output_height,
|
||||
ctx->force_original_aspect_ratio, ctx->force_divisible_by, w_adj);
|
||||
err = ff_scale_adjust_dimensions(inlink, &vpp_ctx->output_width, &vpp_ctx->output_height,
|
||||
ctx->force_original_aspect_ratio,
|
||||
ctx->force_divisible_by, w_adj);
|
||||
if (err < 0)
|
||||
return err;
|
||||
|
||||
if (inlink->w == vpp_ctx->output_width && inlink->h == vpp_ctx->output_height &&
|
||||
(vpp_ctx->input_frames->sw_format == vpp_ctx->output_format ||
|
||||
|
||||
Reference in New Issue
Block a user