From 48d0d287556b2c66dfedda71c018fd5d134e7c80 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim-Philipp=20M=C3=BCller?= Date: Sat, 14 Jul 2012 19:08:24 +0100 Subject: [PATCH] taglist: check value type matches tag type when adding values to a taglist --- gst/gsttaglist.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/gst/gsttaglist.c b/gst/gsttaglist.c index 664969583b..68ecfa1dfa 100644 --- a/gst/gsttaglist.c +++ b/gst/gsttaglist.c @@ -964,6 +964,14 @@ gst_tag_list_add_value_internal (GstTagList * tag_list, GstTagMergeMode mode, } } + if (G_UNLIKELY (!G_VALUE_HOLDS (value, info->type) && + !GST_VALUE_HOLDS_LIST (value))) { + g_warning ("tag '%s' should hold value of type '%s', but value of " + "type '%s' passed", info->nick, g_type_name (info->type), + g_type_name (G_VALUE_TYPE (value))); + return; + } + tag_quark = info->name_quark; if (info->merge_func