After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 560345 - gst_tag_list_get_string() may return NULL or empty string
gst_tag_list_get_string() may return NULL or empty string
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gstreamer (core)
git master
Other All
: Normal normal
: 0.10.24
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2008-11-11 13:52 UTC by Tim-Philipp Müller
Modified: 2009-05-31 15:25 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Tim-Philipp Müller 2008-11-11 13:52:48 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.
Comment 1 Stefan Sauer (gstreamer, gtkdoc dev) 2008-11-11 14:11:19 UTC
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)?
Comment 2 Tim-Philipp Müller 2009-05-31 15:25:58 UTC
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.