diff mbox series

[BlueZ,v2] media: set default value for BAP endpoint Vendor field

Message ID 26d36cc8d645773b6795a18355631134bf2bd074.1675281104.git.pav@iki.fi
State New
Headers show
Series [BlueZ,v2] media: set default value for BAP endpoint Vendor field | expand

Commit Message

Pauli Virtanen Feb. 1, 2023, 7:51 p.m. UTC
The "Vendor" field is optional, and should have an initialized valid
default value.

It has the default values in register_endpoint, but not in
app_register_endpoint, so make the latter match the former.
---

Notes:
    v2: Let's not use C99 initializers.
    
    The uninitialized values cause Pipewire media endpoint registrations to
    fail, and this makes it work again. Its BAP media endpoints do not have
    the Vendor field, given that they use LC3, so the struct in
    app_register_endpoint ends up containing random garbage.  The resulting
    invalid codec/cid/vid value combination is rejected by
    bt_bap_add_vendor_pac.

 profiles/audio/media.c | 2 ++
 1 file changed, 2 insertions(+)

Comments

patchwork-bot+bluetooth@kernel.org Feb. 1, 2023, 9:50 p.m. UTC | #1
Hello:

This patch was applied to bluetooth/bluez.git (master)
by Luiz Augusto von Dentz <luiz.von.dentz@intel.com>:

On Wed,  1 Feb 2023 19:51:47 +0000 you wrote:
> The "Vendor" field is optional, and should have an initialized valid
> default value.
> 
> It has the default values in register_endpoint, but not in
> app_register_endpoint, so make the latter match the former.
> ---
> 
> [...]

Here is the summary with links:
  - [BlueZ,v2] media: set default value for BAP endpoint Vendor field
    https://git.kernel.org/pub/scm/bluetooth/bluez.git/?id=67395a3b357d

You are awesome, thank you!
diff mbox series

Patch

diff --git a/profiles/audio/media.c b/profiles/audio/media.c
index d96367454..8a2afd04c 100644
--- a/profiles/audio/media.c
+++ b/profiles/audio/media.c
@@ -2583,6 +2583,8 @@  static void app_register_endpoint(void *data, void *user_data)
 
 	dbus_message_iter_get_basic(&iter, &codec);
 
+	memset(&vendor, 0, sizeof(vendor));
+
 	if (g_dbus_proxy_get_property(proxy, "Vendor", &iter)) {
 		if (dbus_message_iter_get_arg_type(&iter) != DBUS_TYPE_UINT32)
 			goto fail;