aboutsummaryrefslogtreecommitdiffstats
path: root/src/output/pulse_plugin.c
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2008-11-05 08:06:39 +0100
committerMax Kellermann <max@duempel.org>2008-11-05 08:06:39 +0100
commit3defcef5f3b4d0d0f928832bce012587abae3a16 (patch)
tree8dc4e6ad0615a5b104d30c249ed65a6a986e8d5a /src/output/pulse_plugin.c
parenteedbd28ec9fd07c25c19352f3ad854b153c02720 (diff)
downloadmpd-3defcef5f3b4d0d0f928832bce012587abae3a16.tar.gz
mpd-3defcef5f3b4d0d0f928832bce012587abae3a16.tar.xz
mpd-3defcef5f3b4d0d0f928832bce012587abae3a16.zip
pulse: check if connection is open in pulse_cancel()
The pulse plugin crashed with a segmentation fault when the pulse server was killed.
Diffstat (limited to '')
-rw-r--r--src/output/pulse_plugin.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/output/pulse_plugin.c b/src/output/pulse_plugin.c
index 3d9292ac7..7d935c50a 100644
--- a/src/output/pulse_plugin.c
+++ b/src/output/pulse_plugin.c
@@ -162,6 +162,9 @@ static void pulse_cancel(void *data)
struct pulse_data *pd = data;
int error;
+ if (pd->s == NULL)
+ return;
+
if (pa_simple_flush(pd->s, &error) < 0)
g_warning("Flush failed in PulseAudio output \"%s\": %s\n",
audio_output_get_name(pd->ao),