Sophie

Sophie

distrib > Mandriva > 2010.1 > i586 > media > main-testing-src > by-pkgid > 21c921d7e2a28ff702b2a7da09d43ed6 > files > 89

pulseaudio-0.9.21-26.0.4mdv2010.1.src.rpm

From 2c564f2e9e6a02def7cdfe03efa70a717c91aa5b Mon Sep 17 00:00:00 2001
From: Colin Guthrie <cguthrie@mandriva.org>
Date: Sat, 18 Sep 2010 10:35:38 +0100
Subject: [PATCH 188/190] xcb: Ensure the XCB connection is valid before using it.

---
 src/pulse/client-conf-x11.c |    5 +++++
 src/utils/pax11publish.c    |    5 +++++
 2 files changed, 10 insertions(+), 0 deletions(-)

diff --git a/src/pulse/client-conf-x11.c b/src/pulse/client-conf-x11.c
index 565f997..0348a2f 100644
--- a/src/pulse/client-conf-x11.c
+++ b/src/pulse/client-conf-x11.c
@@ -55,6 +55,11 @@ int pa_client_conf_from_x11(pa_client_conf *c, const char *dname) {
         goto finish;
     }
 
+    if (xcb_connection_has_error(xcb)) {
+        pa_log(_("xcb_connection_has_error() returned true"));
+        goto finish;
+    }
+
     if (pa_x11_get_prop(xcb, "PULSE_SERVER", t, sizeof(t))) {
         pa_bool_t disable_autospawn = TRUE;
 
diff --git a/src/utils/pax11publish.c b/src/utils/pax11publish.c
index 111bee2..62b798c 100644
--- a/src/utils/pax11publish.c
+++ b/src/utils/pax11publish.c
@@ -100,6 +100,11 @@ int main(int argc, char *argv[]) {
         goto finish;
     }
 
+    if (xcb_connection_has_error(xcb)) {
+        pa_log(_("xcb_connection_has_error() returned true"));
+        goto finish;
+    }
+
     switch (mode) {
         case DUMP: {
             char t[1024];
-- 
1.7.2.3