vaapidecode: bail early if not caps in decide_allocation()
authorVíctor Manuel Jáquez Leal <victorx.jaquez@intel.com>
Thu, 10 Mar 2016 15:42:04 +0000 (16:42 +0100)
committerVíctor Manuel Jáquez Leal <victorx.jaquez@intel.com>
Mon, 18 Apr 2016 17:07:55 +0000 (19:07 +0200)
gst/vaapi/gstvaapidecode.c

index 7857a0a..1d8e6f9 100644 (file)
@@ -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