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 559643 - Don't allow empty or NULL strings in taglists
Don't allow empty or NULL strings in taglists
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gstreamer (core)
0.10.x
Other Linux
: Normal normal
: 0.10.24
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2008-11-06 19:11 UTC by Michael Terry
Modified: 2009-05-31 14:44 UTC
See Also:
GNOME target: ---
GNOME version: 2.21/2.22


Attachments
Proposed patch (564 bytes, patch)
2008-11-06 19:11 UTC, Michael Terry
none Details | Review
Commented version (1.13 KB, patch)
2008-11-07 16:47 UTC, Michael Terry
rejected Details | Review

Description Michael Terry 2008-11-06 19:11:24 UTC
Totem-gstreamer currently accepts the empty string "" as title or artist.  Yet, if these same fields are NULL, totem uses intelligent fallbacks.  They should be treated the same.

The symptom of this bug is that when playing a movie file with empty title and artist tags, " - " shows up as the title of the file (in both the window title and playlist).

The xine backend does this already.
Comment 1 Michael Terry 2008-11-06 19:11:49 UTC
Created attachment 122145 [details] [review]
Proposed patch
Comment 2 Philip Withnall 2008-11-06 23:56:35 UTC
Perhaps a comment explaining why that code's there would be a good idea?
Comment 3 Tim-Philipp Müller 2008-11-07 09:30:21 UTC
What sort of stream/file do you run into this with btw? I'd like to fix the GStreamer element posting those tags as well.

Comment 4 Michael Terry 2008-11-07 16:47:50 UTC
Created attachment 122188 [details] [review]
Commented version

Here's a version that adds a little note explaining why it NULLs empty strings.  I also added the same note to the code in the xine backend that does the same thing.

Tim-Philipp, I ran into this on a .wmv file I had.  I agree it makes sense to do this at the gstreamer level too (assuming empty strings never have any special meaning).  Do some gst elements already do this for totem?
Comment 5 Philip Withnall 2008-11-28 23:52:07 UTC
Looks good to me. Please commit to trunk.
Comment 6 Bastien Nocera 2008-11-29 01:02:38 UTC
No. I'd want the GStreamer plugins to be fixed. The only one I can think of that's creating the problems is the ASF demuxer.

I'd accept a patch to print out a warning when an empty metadata is put through Totem (flagging a bug in a GStreamer element).
Comment 7 Michael Terry 2008-12-01 14:45:42 UTC
Bastien, again, I agree that the gst plugin should be fixed as well.  But doesn't it make sense to sanitize what you get from gst?  Anyone can drop in plugins for it; it's not like it's either a trusted or controlled source.

Would you accept a patch that does both?  Sanitize and warn?
Comment 8 Bastien Nocera 2008-12-05 12:48:26 UTC
(In reply to comment #7)
> Bastien, again, I agree that the gst plugin should be fixed as well.  But
> doesn't it make sense to sanitize what you get from gst?  Anyone can drop in
> plugins for it; it's not like it's either a trusted or controlled source.

Yeah, and additional plugins can also make us crash. So the problem is the same, we need to trust the plugins to do the right thing.

> Would you accept a patch that does both?  Sanitize and warn?

I'd rather the GStreamer developers added something like that to gst-launch's -t option, but if they refuse, we could add it to Totem.

Could you check which plugin is causing the problem and eventually provide a test file?
Comment 9 Tim-Philipp Müller 2009-05-31 14:44:15 UTC
Empty strings and NULL strings in taglists shouldn't be allowed in the first place, and any plugins that do that should be fixed IMHO, so let's disallow that in GStreamer:

 commit 30c890c7a2b8140da0ac2fd964a7023cd5fb22ca
 Author: Tim-Philipp Müller <tim.muller@collabora.co.uk>
 Date:   Sat May 30 20:50:40 2009 +0100

    taglists: warn if someone tries to add empty or NULL string tags to a taglist
    
    Also warn if an element or application tries to add a field with an
    empty string to a structure (NULL strings are still needed and
    allowed though) and do all those checks in the right function.
    
    Fixes #559643.