GNOME Bugzilla – Bug 162924
[playbin] totem assertion failures when playing cd / potential crash due to accessing freed memory
Last modified: 2005-01-05 14:59:15 UTC
This code in gstplaybasebin.c structure = gst_caps_get_structure (caps, 0); gst_caps_free (caps); mimetype = gst_structure_get_name (structure); if (g_str_has_prefix (mimetype, "audio/x-raw") ..... causes assertion failures like GLib-CRITICAL **: file gstrfuncs.c: line 2660 (g_str_has_prefix): assertion `str != NULL' failed in totem, e.g. when trying to play back a CD. This is the same that Stephane Loeuillet mentioned earlier in bug #162913, and a potential crasher. The problem is that the returned GstStructure belongs to the caps and is freed with the caps when they are freed; gst_structure_get_name (structure) then accesses already freed memory. Patch attached. Cheers -Tim
Created attachment 35434 [details] [review] patch
Created attachment 35436 [details] [review] better patch Don't make assumptions about implementation details of GstStructure (ie that the name is backed up by GQuarks and thus the const string valid after the structure is freed). Cheers -Tim
commited, thanks