[gst-cvs] gst-plugins-good: pulsesink: check pointer before accessing

Stefan Kost ensonic at kemper.freedesktop.org
Wed Jun 3 08:26:47 PDT 2009


Module: gst-plugins-good
Branch: master
Commit: 44956f98d73053a2265cb196e08327cff013676e
URL:    http://cgit.freedesktop.org/gstreamer/gst-plugins-good/commit/?id=44956f98d73053a2265cb196e08327cff013676e

Author: Stefan Kost <ensonic at users.sf.net>
Date:   Wed Jun  3 18:23:53 2009 +0300

pulsesink: check pointer before accessing

Move existing check a few lines up, so that we check before accessing fields.

---

 ext/pulse/pulsesink.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/ext/pulse/pulsesink.c b/ext/pulse/pulsesink.c
index acb0062..36d5b1b 100644
--- a/ext/pulse/pulsesink.c
+++ b/ext/pulse/pulsesink.c
@@ -1718,12 +1718,12 @@ gst_pulsesink_change_title (GstPulseSink * psink, const gchar * t)
 
   pbuf = GST_PULSERING_BUFFER_CAST (GST_BASE_AUDIO_SINK (psink)->ringbuffer);
 
-  g_free (pbuf->stream_name);
-  pbuf->stream_name = g_strdup (t);
-
   if (pbuf == NULL || pbuf->stream == NULL)
     goto no_buffer;
 
+  g_free (pbuf->stream_name);
+  pbuf->stream_name = g_strdup (t);
+
   if (!(o = pa_stream_set_name (pbuf->stream, pbuf->stream_name, NULL, NULL)))
     goto name_failed;
 





More information about the Gstreamer-commits mailing list