File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -148,7 +148,7 @@ const struct bt_bap_base *bt_bap_base_get_base_from_ad(const struct bt_data *ad)
148
148
/* Pull all data to verify that the result BASE is valid */
149
149
base_pull_pd (& net_buf );
150
150
subgroup_count = net_buf_simple_pull_u8 (& net_buf );
151
- if (subgroup_count == 0 || subgroup_count > BASE_SUBGROUP_MAX_COUNT ) {
151
+ if (! IN_RANGE ( subgroup_count , 1U , BASE_SUBGROUP_MAX_COUNT ) ) {
152
152
LOG_DBG ("Invalid subgroup count: %u" , subgroup_count );
153
153
154
154
return NULL ;
@@ -164,7 +164,7 @@ const struct bt_bap_base *bt_bap_base_get_base_from_ad(const struct bt_data *ad)
164
164
}
165
165
166
166
bis_count = base_pull_bis_count (& net_buf );
167
- if (bis_count == 0 || bis_count > BT_ISO_MAX_GROUP_ISO_COUNT ) {
167
+ if (! IN_RANGE ( bis_count , 1U , BT_ISO_MAX_GROUP_ISO_COUNT ) ) {
168
168
LOG_DBG ("Subgroup[%u]: Invalid BIS count: %u" , i , bis_count );
169
169
170
170
return NULL ;
@@ -202,7 +202,7 @@ const struct bt_bap_base *bt_bap_base_get_base_from_ad(const struct bt_data *ad)
202
202
}
203
203
204
204
bis_index = net_buf_simple_pull_u8 (& net_buf );
205
- if (bis_index == 0 || bis_index > BT_ISO_BIS_INDEX_MAX ) {
205
+ if (! IN_RANGE ( bis_index , 1U , BT_ISO_BIS_INDEX_MAX ) ) {
206
206
LOG_DBG ("Subgroup[%u]: Invalid BIS index: %u" , i , bis_index );
207
207
208
208
return NULL ;
You can’t perform that action at this time.
0 commit comments