From 3dff64364f5f1fec50a8b90ced093a6fe680c343 Mon Sep 17 00:00:00 2001 From: Pauli Virtanen Date: Wed, 18 Mar 2026 19:14:04 +0200 Subject: [PATCH] bluez5: media-source: don't crash if BAP streams doesn't have iso_io Don't crash in update_target_latency() if a BAP stream doesn't have iso_io for some reason. --- spa/plugins/bluez5/media-source.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/spa/plugins/bluez5/media-source.c b/spa/plugins/bluez5/media-source.c index da2e57b5a..e1c01d90c 100644 --- a/spa/plugins/bluez5/media-source.c +++ b/spa/plugins/bluez5/media-source.c @@ -1784,7 +1784,7 @@ static uint32_t get_samples(struct impl *this, int64_t *duration_ns) static void update_target_latency(struct impl *this) { struct port *port = &this->port; - int32_t target; + int32_t target = 0; int samples; if (this->transport == NULL || !port->have_format) @@ -1803,7 +1803,7 @@ static void update_target_latency(struct impl *this) */ if (this->decode_buffer_target) target = this->decode_buffer_target; - else + else if (this->transport->iso_io) target = spa_bt_iso_io_get_source_target_latency(this->transport->iso_io); spa_bt_decode_buffer_set_target_latency(&port->buffer, target);