control: fix event compare function

We can only compare UMP when both types are 2 or 4, so it must be
different from 2 *and* 4 to be rejected.

Fixes #4899
This commit is contained in:
Wim Taymans 2025-09-16 10:47:12 +02:00
parent 24ab601201
commit 5212649ee1
2 changed files with 4 additions and 4 deletions

View file

@ -1513,8 +1513,8 @@ static inline int event_sort(struct spa_pod_control *a, struct spa_pod_control *
uint32_t *sa = SPA_POD_BODY(&a->value), *sb = SPA_POD_BODY(&b->value);
if (SPA_POD_BODY_SIZE(&a->value) < 4 || SPA_POD_BODY_SIZE(&b->value) < 4)
return 0;
if ((sa[0] >> 28) != 2 || (sa[0] >> 28) != 4 ||
(sb[0] >> 28) != 2 || (sb[0] >> 28) != 4)
if (((sa[0] >> 28) != 2 && (sa[0] >> 28) != 4) ||
((sb[0] >> 28) != 2 && (sb[0] >> 28) != 4))
return 0;
return event_compare(sa[0] >> 16, sb[0] >> 16);
}

View file

@ -662,8 +662,8 @@ static inline int event_sort(struct spa_pod_control *a, struct spa_pod_control *
uint32_t *da = SPA_POD_BODY(&a->value), *db = SPA_POD_BODY(&b->value);
if (SPA_POD_BODY_SIZE(&a->value) < 4 || SPA_POD_BODY_SIZE(&b->value) < 4)
return 0;
if ((da[0] >> 28) != 2 || (da[0] >> 28) != 4 ||
(db[0] >> 28) != 2 || (db[0] >> 28) != 4)
if (((da[0] >> 28) != 2 && (da[0] >> 28) != 4) ||
((db[0] >> 28) != 2 && (db[0] >> 28) != 4))
return 0;
return event_compare(da[0] >> 16, db[0] >> 16);
}