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 Arun Raghavan
parent bb28a59d5b
commit de65529d52

View file

@ -4507,6 +4507,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 */
@ -4515,8 +4517,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;
}