summaryrefslogtreecommitdiff
path: root/gst
diff options
context:
space:
mode:
authorMatthew Waters <matthew@centricular.com>2016-09-26 23:59:29 +1000
committerMatthew Waters <matthew@centricular.com>2016-10-19 22:24:27 +1100
commit3654d844c152db4faced42c15ed40e05b7bd4177 (patch)
tree55e7c8c9d3bf2eee5b24105ef85374328f67b092 /gst
parentc57cb35ae6766e3c8937afe2d89a2ed612866dd0 (diff)
element: check for invalid gstcontext's being provided to set_context
https://bugzilla.gnome.org/show_bug.cgi?id=771773
Diffstat (limited to 'gst')
-rw-r--r--gst/gstelement.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/gst/gstelement.c b/gst/gstelement.c
index dc76fac29b..05bed116a0 100644
--- a/gst/gstelement.c
+++ b/gst/gstelement.c
@@ -3152,8 +3152,11 @@ gst_element_set_context_default (GstElement * element, GstContext * context)
const gchar *context_type;
GList *l;
- GST_OBJECT_LOCK (element);
+ g_return_if_fail (GST_IS_CONTEXT (context));
context_type = gst_context_get_context_type (context);
+ g_return_if_fail (context_type != NULL);
+
+ GST_OBJECT_LOCK (element);
for (l = element->contexts; l; l = l->next) {
GstContext *tmp = l->data;
const gchar *tmp_type = gst_context_get_context_type (tmp);
@@ -3190,6 +3193,7 @@ gst_element_set_context (GstElement * element, GstContext * context)
GstElementClass *oclass;
g_return_if_fail (GST_IS_ELEMENT (element));
+ g_return_if_fail (GST_IS_CONTEXT (context));
oclass = GST_ELEMENT_GET_CLASS (element);