aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTimo Rothenpieler <timo@rothenpieler.org>2016-10-10 12:57:29 +0200
committerTimo Rothenpieler <timo@rothenpieler.org>2016-11-22 10:34:27 +0100
commit0faf3c3a25ede9ecfdb1cf68a0f8aef23c25197a (patch)
treeb8317e0e244aa5413c47ba9700e01f0b9f90f81f
parentb0ca90d7cbccfea0a6f2a37f9fe37449a2631d1d (diff)
downloadffmpeg-0faf3c3a25ede9ecfdb1cf68a0f8aef23c25197a.tar.gz
avfilter/vf_hwupload_cuda: check ff_formats_ref for errors
-rw-r--r--libavfilter/vf_hwupload_cuda.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/libavfilter/vf_hwupload_cuda.c b/libavfilter/vf_hwupload_cuda.c
index dba496fc1e..14688df23f 100644
--- a/libavfilter/vf_hwupload_cuda.c
+++ b/libavfilter/vf_hwupload_cuda.c
@@ -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;
}