From 3cb26e9bcf994b85767e67a51aac6339a69c260c Mon Sep 17 00:00:00 2001 From: Johan Hedberg Date: Wed, 25 Mar 2009 00:16:32 +0200 Subject: [PATCH] Handle sink->session == NULL && session == NULL correctly in sink_setup_stream --- audio/sink.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/audio/sink.c b/audio/sink.c index 9140633ef..b899288b4 100644 --- a/audio/sink.c +++ b/audio/sink.c @@ -487,6 +487,9 @@ gboolean sink_setup_stream(struct sink *sink, struct avdtp *session) if (session && !sink->session) sink->session = avdtp_ref(session); + if (!sink->session) + return FALSE; + if (avdtp_discover(sink->session, discovery_complete, sink) < 0) return FALSE;