From 7f0bf0872819467804d9add28578c570383efcbf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Manuel=20J=C3=A1quez=20Leal?= Date: Thu, 10 Mar 2016 16:42:04 +0100 Subject: [PATCH] vaapidecode: bail early if not caps in decide_allocation() --- gst/vaapi/gstvaapidecode.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/gst/vaapi/gstvaapidecode.c b/gst/vaapi/gstvaapidecode.c index 7857a0a09a..1d8e6f9cad 100644 --- a/gst/vaapi/gstvaapidecode.c +++ b/gst/vaapi/gstvaapidecode.c @@ -733,7 +733,12 @@ gst_vaapidecode_decide_allocation (GstVideoDecoder * vdec, GstQuery * query) GstCaps *caps = NULL; gst_query_parse_allocation (query, &caps, NULL); + decode->has_texture_upload_meta = FALSE; + + if (!caps) + goto error_no_caps; + #if (USE_GLX || USE_EGL) decode->has_texture_upload_meta = gst_query_find_allocation_meta (query, @@ -744,6 +749,13 @@ gst_vaapidecode_decide_allocation (GstVideoDecoder * vdec, GstQuery * query) return gst_vaapi_plugin_base_decide_allocation (GST_VAAPI_PLUGIN_BASE (vdec), query, 0); + + /* ERRORS */ +error_no_caps: + { + GST_ERROR_OBJECT (decode, "no caps specified"); + return FALSE; + } } static inline gboolean