GNOME Bugzilla – Bug 707536
collectpads: unref of NULL pointer after pad removal
Last modified: 2013-09-09 10:40:33 UTC
Created attachment 254155 [details] [review] patch to fix If a pad is removed while a collectpads element (say adder) is in a chain function waiting to be collected, there is a possibility that an unref happens on a NULL pointer. The code below shows the pad_removed label would only be gone to when data is NULL: if (G_UNLIKELY ((data = gst_pad_get_element_private (pad)) == NULL)) goto pad_removed; Yet in pad_removed, it does a goto unlock_done: pad_removed: { GST_WARNING ("%s got removed from collectpads", GST_OBJECT_NAME (pad)); GST_OBJECT_UNLOCK (pad); ret = GST_FLOW_NOT_LINKED; goto unlock_done; } And in unlock_done, unref_data is done on data, which in this case is guaranteed to be NULL.
commit d1d99af22973dd379d95fa477097576275ec1394 Author: Zaheer Abbas Merali <zaheermerali@gmail.com> Date: Thu Sep 5 14:14:42 2013 +0200 collectpads: Don't unref NULL GstCollectData If a pad is removed while a collectpads element (say adder) is in a chain function waiting to be collected, there is a possibility that an unref happens on a NULL pointer. https://bugzilla.gnome.org/show_bug.cgi?id=707536
Comment on attachment 254155 [details] [review] patch to fix Please in "git format-patch" style next time :)
Should this be picked into 1.0 as well ?
Yes please!
Cherry-picked into 1.0