vaapivideocontext: check if query context is NULL
authorVíctor Manuel Jáquez Leal <victorx.jaquez@intel.com>
Fri, 24 Jun 2016 10:05:24 +0000 (12:05 +0200)
committerVíctor Manuel Jáquez Leal <victorx.jaquez@intel.com>
Fri, 24 Jun 2016 10:24:55 +0000 (12:24 +0200)
Under certain conditions the element might receive a positive context query
but without a context instance. This situation will lead to a segmentation
fault when traversing the context list in the pipeline.

https://bugzilla.gnome.org/show_bug.cgi?id=767946

gst/vaapi/gstvaapivideocontext.c

index c90ede7..cb5b68e 100644 (file)
@@ -141,6 +141,9 @@ _gst_context_get_from_query (GstElement * element, GstQuery * query,
     return FALSE;
 
   gst_query_parse_context (query, &ctxt);
+  if (!ctxt)
+    return FALSE;
+
   GST_CAT_INFO_OBJECT (GST_CAT_CONTEXT, element,
       "found context (%" GST_PTR_FORMAT ") in %s query", ctxt,
       direction == GST_PAD_SRC ? "downstream" : "upstream");