diff --git a/libs/gst/base/gstbasesrc.c b/libs/gst/base/gstbasesrc.c index 595c467862..8db41f63c5 100644 --- a/libs/gst/base/gstbasesrc.c +++ b/libs/gst/base/gstbasesrc.c @@ -1759,8 +1759,11 @@ gst_base_src_event_handler (GstPad * pad, GstEvent * event) gboolean result = FALSE; src = GST_BASE_SRC (gst_pad_get_parent (pad)); - if (G_UNLIKELY (src == NULL)) + if (G_UNLIKELY (src == NULL)) { + gst_event_unref (event); return FALSE; + } + bclass = GST_BASE_SRC_GET_CLASS (src); if (bclass->event) { diff --git a/libs/gst/base/gstbasetransform.c b/libs/gst/base/gstbasetransform.c index 95d0f45366..88753361d7 100644 --- a/libs/gst/base/gstbasetransform.c +++ b/libs/gst/base/gstbasetransform.c @@ -2085,13 +2085,17 @@ gst_base_transform_src_event (GstPad * pad, GstEvent * event) gboolean ret = TRUE; trans = GST_BASE_TRANSFORM (gst_pad_get_parent (pad)); - if (G_UNLIKELY (trans == NULL)) + if (G_UNLIKELY (trans == NULL)) { + gst_event_unref (event); return FALSE; + } bclass = GST_BASE_TRANSFORM_GET_CLASS (trans); if (bclass->src_event) ret = bclass->src_event (trans, event); + else + gst_event_unref (event); gst_object_unref (trans);