mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-26 10:10:32 +00:00
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:
parent
bb28a59d5b
commit
de65529d52
1 changed files with 3 additions and 2 deletions
|
@ -4507,6 +4507,8 @@ gst_base_sink_send_event (GstElement * element, GstEvent * event)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (forward) {
|
if (forward) {
|
||||||
|
GST_DEBUG_OBJECT (basesink, "sending event %p %" GST_PTR_FORMAT, event,
|
||||||
|
event);
|
||||||
result = gst_pad_push_event (pad, event);
|
result = gst_pad_push_event (pad, event);
|
||||||
} else {
|
} else {
|
||||||
/* not forwarded, unref the event */
|
/* not forwarded, unref the event */
|
||||||
|
@ -4515,8 +4517,7 @@ gst_base_sink_send_event (GstElement * element, GstEvent * event)
|
||||||
|
|
||||||
gst_object_unref (pad);
|
gst_object_unref (pad);
|
||||||
|
|
||||||
GST_DEBUG_OBJECT (basesink, "handled event %p %" GST_PTR_FORMAT ": %d", event,
|
GST_DEBUG_OBJECT (basesink, "handled event: %d", result);
|
||||||
event, result);
|
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue