bluez5: Don't assume channels fit in uint8_t

There is no reason to believe the number of channels can fit in a
uint8_t. Limit the number of channels in some places where it can not
be avoided.
This commit is contained in:
Wim Taymans 2025-04-04 16:05:51 +02:00
parent 74e6e6c29d
commit 532140ca90
2 changed files with 4 additions and 4 deletions

View file

@ -903,7 +903,7 @@ static int codec_caps_preference_cmp(const struct media_codec *codec, uint32_t f
static uint8_t channels_to_positions(uint32_t channels, uint32_t *position)
{
uint8_t n_channels = get_channel_count(channels);
uint32_t n_channels = get_channel_count(channels);
uint8_t n_positions = 0;
spa_assert(n_channels <= SPA_AUDIO_MAX_CHANNELS);