From 99a534271a1c02f9d3b7c38f89e98a963c01c482 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Sebastian=20Dr=C3=B6ge?= Date: Tue, 10 Jul 2018 08:48:47 +0200 Subject: [PATCH] sample: Set buffer/caps/buffer-lists to NULL correctly when replacing them with NULL --- gst/gstsample.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/gst/gstsample.c b/gst/gstsample.c index eca4683..b73461d 100644 --- a/gst/gstsample.c +++ b/gst/gstsample.c @@ -287,6 +287,8 @@ gst_sample_set_buffer_list (GstSample * sample, GstBufferList * buffer_list) sample->buffer_list = gst_buffer_list_ref (buffer_list); gst_mini_object_add_parent (GST_MINI_OBJECT_CAST (sample->buffer_list), GST_MINI_OBJECT_CAST (sample)); + } else { + sample->buffer_list = NULL; } if (old) { @@ -322,6 +324,8 @@ gst_sample_set_buffer (GstSample * sample, GstBuffer * buffer) sample->buffer = gst_buffer_ref (buffer); gst_mini_object_add_parent (GST_MINI_OBJECT_CAST (sample->buffer), GST_MINI_OBJECT_CAST (sample)); + } else { + sample->buffer = NULL; } if (old) { @@ -357,6 +361,8 @@ gst_sample_set_caps (GstSample * sample, GstCaps * caps) sample->caps = gst_caps_ref (caps); gst_mini_object_add_parent (GST_MINI_OBJECT_CAST (sample->caps), GST_MINI_OBJECT_CAST (sample)); + } else { + sample->caps = NULL; } if (old) { -- 2.7.4