blob: 746d24511dd9f53435d94a31fafb2ed3a44bc1ba (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
|
From 411fd3d4e7b3f076a14c8eae7be976ce17b686ca Mon Sep 17 00:00:00 2001
From: Julian Bouzas <julian.bouzas@collabora.com>
Date: Fri, 30 Aug 2019 08:45:11 -0400
Subject: [PATCH] a2dp-sink: check if transport is valid before releasing it
Upstream-Status: Pending
---
spa/plugins/bluez5/a2dp-sink.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/spa/plugins/bluez5/a2dp-sink.c b/spa/plugins/bluez5/a2dp-sink.c
index d6d9e7d6..041d75bb 100644
--- a/spa/plugins/bluez5/a2dp-sink.c
+++ b/spa/plugins/bluez5/a2dp-sink.c
@@ -866,7 +866,7 @@ static int do_remove_source(struct spa_loop *loop,
static int do_stop(struct impl *this)
{
- int res;
+ int res = 0;
if (!this->started)
return 0;
@@ -877,7 +877,8 @@ static int do_stop(struct impl *this)
this->started = false;
- res = spa_bt_transport_release(this->transport);
+ if (this->transport)
+ res = spa_bt_transport_release(this->transport);
return res;
}
--
2.23.0.rc1
|