mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2024-12-28 20:53:54 +02:00
avfilter/vf_scale: test return code of scale_frame()
Instead of testing the returned frame against NULL, test the return code itself, going more in line with the usual behavior of such functions.
This commit is contained in:
parent
084e0b364d
commit
0deb301ba9
@ -883,7 +883,6 @@ static int scale_frame(AVFilterLink *link, AVFrame **frame_in,
|
||||
int frame_changed;
|
||||
|
||||
*frame_in = NULL;
|
||||
*frame_out = NULL;
|
||||
if (in->colorspace == AVCOL_SPC_YCGCO)
|
||||
av_log(link->dst, AV_LOG_WARNING, "Detected unsupported YCgCo colorspace.\n");
|
||||
|
||||
@ -1064,14 +1063,15 @@ FF_ENABLE_DEPRECATION_WARNINGS
|
||||
}
|
||||
|
||||
ret = scale_frame(ctx->inputs[0], &in, &out);
|
||||
if (out) {
|
||||
out->pts = av_rescale_q(fs->pts, fs->time_base, outlink->time_base);
|
||||
return ff_filter_frame(outlink, out);
|
||||
}
|
||||
if (ret < 0)
|
||||
goto err;
|
||||
|
||||
av_assert0(out);
|
||||
out->pts = av_rescale_q(fs->pts, fs->time_base, outlink->time_base);
|
||||
return ff_filter_frame(outlink, out);
|
||||
|
||||
err:
|
||||
if (ret < 0)
|
||||
av_frame_free(&in);
|
||||
av_frame_free(&in);
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user