From f14efbd70c179a0c64e2acd6f6b32b7f6e1a6686 Mon Sep 17 00:00:00 2001 From: Arun Raghavan Date: Wed, 11 Sep 2024 12:12:11 -0400 Subject: [PATCH] gstreamer: Set data to null if it's consumed When the probe has HANDLED the data, we're expecting the caller to no longer access it. Let's explicitly protect against that by setting the data to NULL on return. Part-of: --- gstreamer/src/pad.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/gstreamer/src/pad.rs b/gstreamer/src/pad.rs index 0419a14a9..05418f318 100644 --- a/gstreamer/src/pad.rs +++ b/gstreamer/src/pad.rs @@ -1045,6 +1045,7 @@ unsafe fn update_probe_info( || data_type == Some(Event::static_type()) => { // Buffer or Event consumed by probe + (*info).data = ptr::null_mut(); } other => panic!("Bad data for {data_type:?} pad probe returning Handled: {other:?}"), }