pod: fix alignment check

Use the platform specific alignment for the spa_pod instead of 8.

Fixes things on 32 bits.
This commit is contained in:
Wim Taymans 2022-09-29 16:51:42 +02:00
parent 41fd8144f0
commit 07fd063a0d

View file

@ -91,7 +91,7 @@ spa_pod_parser_deref(struct spa_pod_parser *parser, uint32_t offset, uint32_t si
* Check that the pointer is aligned and that the size (rounded
* to the next multiple of 8) is in bounds.
*/
if (SPA_IS_ALIGNED(pod, 8) &&
if (SPA_IS_ALIGNED(pod, __alignof__(struct spa_pod)) &&
long_offset + SPA_ROUND_UP_N((uint64_t)SPA_POD_BODY_SIZE(pod), 8) <= size)
return (struct spa_pod *)pod;
}