Commit db5767e5 authored by Mariusz Skamra's avatar Mariusz Skamra Committed by Carles Cufi
Browse files

Bluetooth: audio: Accept empty CCID list in audio metadata

The CCID list can be empty, as the Assigned Numbers is not strict
regarding it's minimum length.

Fixes: #59666
Signed-off-by: default avatarMariusz Skamra <mariusz.skamra@codecoup.pl>
parent a32ba627
Loading
Loading
Loading
Loading
+1 −6
Changes for samples/bluetooth/hap_ha/src/bap_unicast_sr.c: 1 added line, 6 removed lines.
Original line number Diff line number Diff line
@@ -297,12 +297,7 @@ static bool valid_metadata_type(uint8_t type, uint8_t len)
		}

		return true;
	case BT_AUDIO_METADATA_TYPE_CCID_LIST: /* 2 - 254 octets */
		if (len < 2) {
			return false;
		}

		return true;
	case BT_AUDIO_METADATA_TYPE_CCID_LIST:
	case BT_AUDIO_METADATA_TYPE_PROGRAM_INFO: /* 0 - 255 octets */
	case BT_AUDIO_METADATA_TYPE_PROGRAM_INFO_URI: /* 0 - 255 octets */
		return true;
+1 −6
Changes for samples/bluetooth/tmap_peripheral/src/bap_unicast_sr.c: 1 added line, 6 removed lines.
Original line number Diff line number Diff line
@@ -246,12 +246,7 @@ static bool valid_metadata_type(uint8_t type, uint8_t len)
		}

		return true;
	case BT_AUDIO_METADATA_TYPE_CCID_LIST: /* 2 - 254 octets */
		if (len < 2) {
			return false;
		}

		return true;
	case BT_AUDIO_METADATA_TYPE_CCID_LIST:
	case BT_AUDIO_METADATA_TYPE_PROGRAM_INFO: /* 0 - 255 octets */
	case BT_AUDIO_METADATA_TYPE_PROGRAM_INFO_URI: /* 0 - 255 octets */
		return true;
+1 −6
Changes for samples/bluetooth/unicast_audio_server/src/main.c: 1 added line, 6 removed lines.
Original line number Diff line number Diff line
@@ -438,12 +438,7 @@ static bool valid_metadata_type(uint8_t type, uint8_t len)
		}

		return true;
	case BT_AUDIO_METADATA_TYPE_CCID_LIST: /* 2 - 254 octets */
		if (len < 2) {
			return false;
		}

		return true;
	case BT_AUDIO_METADATA_TYPE_CCID_LIST:
	case BT_AUDIO_METADATA_TYPE_PROGRAM_INFO: /* 0 - 255 octets */
	case BT_AUDIO_METADATA_TYPE_PROGRAM_INFO_URI: /* 0 - 255 octets */
		return true;
+1 −6
Changes for subsys/bluetooth/audio/shell/bap.c: 1 added line, 6 removed lines.
Original line number Diff line number Diff line
@@ -518,12 +518,7 @@ static bool valid_metadata_type(uint8_t type, uint8_t len)
		}

		return true;
	case BT_AUDIO_METADATA_TYPE_CCID_LIST: /* 2 - 254 octets */
		if (len < 2) {
			return false;
		}

		return true;
	case BT_AUDIO_METADATA_TYPE_CCID_LIST:
	case BT_AUDIO_METADATA_TYPE_PROGRAM_INFO: /* 0 - 255 octets */
	case BT_AUDIO_METADATA_TYPE_PROGRAM_INFO_URI: /* 0 - 255 octets */
		return true;
+1 −6
Changes for tests/bluetooth/tester/src/btp_bap.c: 1 added line, 6 removed lines.
Original line number Diff line number Diff line
@@ -360,12 +360,7 @@ static bool valid_metadata_type(uint8_t type, uint8_t len, const uint8_t *data)
		}

		return true;
	case BT_AUDIO_METADATA_TYPE_CCID_LIST: /* 2 - 254 octets */
		if (len < 2) {
			return false;
		}

		return true;
	case BT_AUDIO_METADATA_TYPE_CCID_LIST:
	case BT_AUDIO_METADATA_TYPE_PROGRAM_INFO: /* 0 - 255 octets */
	case BT_AUDIO_METADATA_TYPE_PROGRAM_INFO_URI: /* 0 - 255 octets */
		return true;
Loading