basesink: fix a use after free case

The event may be disposed while being pushed, so we make sure the
debug infrastructure won't use it after the gst_pad_push().
This commit is contained in:
Fabrice Bellet 2016-11-30 21:17:55 +01:00 committed by Sebastian Dröge
parent ed57611c4f
commit 44264ae870

View file

@ -4429,6 +4429,8 @@ gst_base_sink_send_event (GstElement * element, GstEvent * event)
}
if (forward) {
GST_DEBUG_OBJECT (basesink, "sending event %p %" GST_PTR_FORMAT, event,
event);
result = gst_pad_push_event (pad, event);
} else {
/* not forwarded, unref the event */
@ -4437,8 +4439,7 @@ gst_base_sink_send_event (GstElement * element, GstEvent * event)
gst_object_unref (pad);
GST_DEBUG_OBJECT (basesink, "handled event %p %" GST_PTR_FORMAT ": %d", event,
event, result);
GST_DEBUG_OBJECT (basesink, "handled event: %d", result);
return result;
}