From 3821cee574234b87d6737d15c84fde17f7f4b57b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= Date: Tue, 16 Jul 2013 16:24:38 +0200 Subject: [PATCH] query: Don't assert if no context is set in the query --- gst/gstquery.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/gst/gstquery.c b/gst/gstquery.c index 2a9fb2faff..31be0dc726 100644 --- a/gst/gstquery.c +++ b/gst/gstquery.c @@ -2495,13 +2495,17 @@ void gst_query_parse_context (GstQuery * query, GstContext ** context) { GstStructure *structure; + const GValue *v; g_return_if_fail (GST_QUERY_TYPE (query) == GST_QUERY_CONTEXT); g_return_if_fail (context != NULL); structure = GST_QUERY_STRUCTURE (query); - *context = g_value_get_boxed (gst_structure_id_get_value (structure, - GST_QUARK (CONTEXT))); + v = gst_structure_id_get_value (structure, GST_QUARK (CONTEXT)); + if (v) + *context = g_value_get_boxed (v); + else + *context = NULL; } static void