From f30321538b3573977e4955fc4e9b8d120dbb1bcb Mon Sep 17 00:00:00 2001 From: Arun Raghavan Date: Tue, 10 Sep 2024 16:03:05 -0400 Subject: [PATCH] pad: Check data NULL-ness when probes are stopped We were correctly handling this for buffers, but not events and queries. Part-of: --- subprojects/gstreamer/gst/gstpad.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/subprojects/gstreamer/gst/gstpad.c b/subprojects/gstreamer/gst/gstpad.c index 6aee9fc87b..5c0af8291c 100644 --- a/subprojects/gstreamer/gst/gstpad.c +++ b/subprojects/gstreamer/gst/gstpad.c @@ -4578,7 +4578,7 @@ probe_handled: probe_stopped: { /* We unref the buffer, except if the probe handled it (CUSTOM_SUCCESS_1) */ - if (!handled) + if (data && !handled) gst_mini_object_unref (GST_MINI_OBJECT_CAST (data)); switch (ret) { @@ -5647,7 +5647,7 @@ inactive: probe_stopped: { GST_OBJECT_FLAG_SET (pad, GST_PAD_FLAG_PENDING_EVENTS); - if (ret != GST_FLOW_CUSTOM_SUCCESS_1) + if (event && ret != GST_FLOW_CUSTOM_SUCCESS_1) gst_event_unref (event); switch (ret) { @@ -6056,7 +6056,7 @@ probe_stopped: if (need_unlock) GST_PAD_STREAM_UNLOCK (pad); /* Only unref if unhandled */ - if (ret != GST_FLOW_CUSTOM_SUCCESS_1) + if (event && ret != GST_FLOW_CUSTOM_SUCCESS_1) gst_event_unref (event); switch (ret) {