From 3defcef5f3b4d0d0f928832bce012587abae3a16 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Wed, 5 Nov 2008 08:06:39 +0100 Subject: pulse: check if connection is open in pulse_cancel() The pulse plugin crashed with a segmentation fault when the pulse server was killed. --- src/output/pulse_plugin.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/output/pulse_plugin.c') 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), -- cgit v1.2.3