33 lines
1.2 KiB
Diff
33 lines
1.2 KiB
Diff
|
From 424c67ab1e6be34a35a5133f6037950b8bcb25b7 Mon Sep 17 00:00:00 2001
|
||
|
From: Christophe Fergeau <cfergeau@redhat.com>
|
||
|
Date: Fri, 13 Jan 2012 19:19:40 +0100
|
||
|
Subject: [PATCH spice-gtk 1/3] 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
|
||
|
---
|
||
|
gtk/spice-audio.c | 2 ++
|
||
|
1 files changed, 2 insertions(+), 0 deletions(-)
|
||
|
|
||
|
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);
|
||
|
--
|
||
|
1.7.7.4
|
||
|
|