mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2025-01-01 12:22:09 +00:00
avfilter/vf_hwupload_cuda: check ff_formats_ref for errors
This commit is contained in:
parent
b0ca90d7cb
commit
0faf3c3a25
@ -54,6 +54,8 @@ static av_cold void cudaupload_uninit(AVFilterContext *ctx)
|
||||
|
||||
static int cudaupload_query_formats(AVFilterContext *ctx)
|
||||
{
|
||||
int ret;
|
||||
|
||||
static const enum AVPixelFormat input_pix_fmts[] = {
|
||||
AV_PIX_FMT_NV12, AV_PIX_FMT_YUV420P, AV_PIX_FMT_YUV444P,
|
||||
AV_PIX_FMT_NONE,
|
||||
@ -64,8 +66,13 @@ static int cudaupload_query_formats(AVFilterContext *ctx)
|
||||
AVFilterFormats *in_fmts = ff_make_format_list(input_pix_fmts);
|
||||
AVFilterFormats *out_fmts = ff_make_format_list(output_pix_fmts);
|
||||
|
||||
ff_formats_ref(in_fmts, &ctx->inputs[0]->out_formats);
|
||||
ff_formats_ref(out_fmts, &ctx->outputs[0]->in_formats);
|
||||
ret = ff_formats_ref(in_fmts, &ctx->inputs[0]->out_formats);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
|
||||
ret = ff_formats_ref(out_fmts, &ctx->outputs[0]->in_formats);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user