[PATCH spice-gtk 2/2] gstreamer: Avoid dangling pointers in free_pipeline

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]


Although currently after free_pipeline we free the entire structure
the name and the function suggests that we only free the pipeline.
Also this is fixing a future possible problem with the series
from Vivek Kasireddy reusing the SpiceGstDecoder for another
pipeline if H/W encoder pipeline creation fails.

Signed-off-by: Frediano Ziglio <freddy77@xxxxxxxxx>
 src/channel-display-gst.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/channel-display-gst.c b/src/channel-display-gst.c
index 3bd948d2..ffc2edbf 100644
--- a/src/channel-display-gst.c
+++ b/src/channel-display-gst.c
@@ -361,11 +361,14 @@ static void free_pipeline(SpiceGstDecoder *decoder)
     gst_element_set_state(decoder->pipeline, GST_STATE_NULL);
+    decoder->appsrc = NULL;
     if (decoder->appsink) {
+        decoder->appsink = NULL;
-    gst_object_unref(decoder->pipeline);
+    decoder->clock = NULL;
+    gst_object_unref(decoder->pipeline);
     decoder->pipeline = NULL;

[Index of Archives]     [Linux Virtualization]     [Linux Virtualization]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]     [Monitors]