From 07fd063a0d01224b3fb985fd8b20c2c757977e57 Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Thu, 29 Sep 2022 16:51:42 +0200 Subject: [PATCH] pod: fix alignment check Use the platform specific alignment for the spa_pod instead of 8. Fixes things on 32 bits. --- spa/include/spa/pod/parser.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spa/include/spa/pod/parser.h b/spa/include/spa/pod/parser.h index 59987e232..e0546751f 100644 --- a/spa/include/spa/pod/parser.h +++ b/spa/include/spa/pod/parser.h @@ -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; }