From 80c439683091dfabc346af0b521e626a945a3d4d Mon Sep 17 00:00:00 2001 From: =?utf8?q?V=C3=ADctor=20Manuel=20J=C3=A1quez=20Leal?= Date: Fri, 24 Jun 2016 12:05:24 +0200 Subject: [PATCH] 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 --- gst/vaapi/gstvaapivideocontext.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/gst/vaapi/gstvaapivideocontext.c b/gst/vaapi/gstvaapivideocontext.c index c90ede7..cb5b68e 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"); -- 2.7.4