summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZaheer Abbas Merali <zaheermerali@gmail.com>2013-09-05 14:14:42 +0200
committerSebastian Dröge <slomo@circular-chaos.org>2013-09-09 12:40:01 +0200
commit4e880d4d1e151ea64f83c28b5c3e1bbc06c57903 (patch)
treee293a8391500144df46b4cb2fa00cb8c466233f6
parent1125b9a924f4c03fa3c6770c244200213dd6dd84 (diff)
collectpads: Don't unref NULL GstCollectData1.0
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
-rw-r--r--libs/gst/base/gstcollectpads.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/libs/gst/base/gstcollectpads.c b/libs/gst/base/gstcollectpads.c
index b6db9f4e2..e517250dd 100644
--- a/libs/gst/base/gstcollectpads.c
+++ b/libs/gst/base/gstcollectpads.c
@@ -2058,7 +2058,9 @@ gst_collect_pads_chain (GstPad * pad, GstObject * parent, GstBuffer * buffer)
unlock_done:
GST_COLLECT_PADS_STREAM_UNLOCK (pads);
- unref_data (data);
+ /* data is definitely NULL if pad_removed goto was run. */
+ if (data)
+ unref_data (data);
if (buffer)
gst_buffer_unref (buffer);
return ret;