[Spice-commits] gtk/spice-audio.c

Christophe Fergau teuf at kemper.freedesktop.org
Mon Jan 16 02:20:01 PST 2012


 gtk/spice-audio.c |    2 ++
 1 file changed, 2 insertions(+)

New commits:
commit 424c67ab1e6be34a35a5133f6037950b8bcb25b7
Author: Christophe Fergeau <cfergeau at redhat.com>
Date:   Fri Jan 13 19:19:40 2012 +0100

    Handle spice_audio_new failures
    
    spice_audio_new can return a NULL pointer when there's a failure
    during the initialization of the audio system. When this happens,
    we shouldn't keep initializing the spice audio channel as if nothing
    happened, but just stop the connection.
    This can be tested by forcing the "self" variable to NULL in
    spice_audio_new
    This should fix https://bugzilla.redhat.com/show_bug.cgi?id=772118

diff --git a/gtk/spice-audio.c b/gtk/spice-audio.c
index f58a81e..3d6e34c 100644
--- a/gtk/spice-audio.c
+++ b/gtk/spice-audio.c
@@ -221,6 +221,8 @@ SpiceAudio *spice_audio_new(SpiceSession *session, GMainContext *context,
 #ifdef WITH_GSTAUDIO
     self = SPICE_AUDIO(spice_gstaudio_new(session, context, name));
 #endif
+    if (!self)
+        return NULL;
 
     spice_g_signal_connect_object(session, "notify::enable-audio", G_CALLBACK(session_enable_audio), self, 0);
     spice_g_signal_connect_object(session, "channel-new", G_CALLBACK(channel_new), self, 0);


More information about the Spice-commits mailing list