summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVíctor Manuel Jáquez Leal <victorx.jaquez@intel.com>2016-06-24 12:05:24 +0200
committerVíctor Manuel Jáquez Leal <victorx.jaquez@intel.com>2016-06-24 12:24:55 +0200
commit80c439683091dfabc346af0b521e626a945a3d4d (patch)
tree38294a4a7fd1efe3b88167dd661f5ae0e03fcdcb
parent60cd511fada1c19e4bd0111685cf8580e272d2cf (diff)
vaapivideocontext: check if query context is NULL
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
-rw-r--r--gst/vaapi/gstvaapivideocontext.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/gst/vaapi/gstvaapivideocontext.c b/gst/vaapi/gstvaapivideocontext.c
index c90ede7d..cb5b68e1 100644
--- a/gst/vaapi/gstvaapivideocontext.c
+++ b/gst/vaapi/gstvaapivideocontext.c
@@ -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");