GNOME Bugzilla – Bug 560345
gst_tag_list_get_string() may return NULL or empty string
Last modified: 2009-05-31 15:25:58 UTC
It seems like it's possible to add string tags with a NULL value or an empty string to tag lists, which may result in gst_tag_list_get_string() returning TRUE and a NULL string (see bug #560155). That's unexpected to the caller and I can't think of any case where it makes sense to have NULL strings in tags, or empty strings in tags (the empty string case is from a totem buglet, see bug #559643). I think we should either generally disallow NULL + "" for string values in tag lists, or add a GstTagFlag to signal whether empty/null strings are allowed or not, and then just not add such tags to tag lists. GST_TAG_DATE is another case where NULL doesn't make sense.
gst_tag_list_add_value_internal() could ev. filter such tags where the value type is G_TYPE_STRING, G_TYPE_POINTER, G_TYPE_OBJECT, GST_TYPE_DATE (G_TYPE_BOXED)?
commit 7c4e618471eb4218785d5891da46b67de952397e Author: Tim-Philipp Müller <tim.muller@collabora.co.uk> Date: Sun May 31 16:17:45 2009 +0100 taglists: make _get_{string|pointer} return FALSE for NULL values Make gst_tag_list_get_string() return FALSE for NULL strings and empty strings, and gst_tag_list_get_pointer() return FALSE for NULL pointers, like we do with dates and buffers. Fixes #560345.