spa: fix max_position check

This commit is contained in:
Wim Taymans 2025-10-30 11:26:32 +01:00
parent 7706ca6361
commit 056f257058
2 changed files with 2 additions and 2 deletions

View file

@ -314,4 +314,4 @@ static const struct spa_type_info spa_type_audio_volume_ramp_scale[] = {
} /* extern "C" */
#endif
#endif /* SPA_AUDIO_RAW_RAW_TYPES_H */
#endif /* SPA_AUDIO_RAW_TYPES_H */

View file

@ -89,7 +89,7 @@ spa_format_audio_raw_ext_build(struct spa_pod_builder *builder, uint32_t id,
/* we drop the positions here when we can't read all of them. This is
* really a malformed spa_audio_info structure. */
if (!SPA_FLAG_IS_SET(info->flags, SPA_AUDIO_FLAG_UNPOSITIONED) &&
max_position > info->channels) {
info->channels <= max_position) {
spa_pod_builder_add(builder, SPA_FORMAT_AUDIO_position,
SPA_POD_Array(sizeof(uint32_t), SPA_TYPE_Id,
info->channels, info->position), 0);