diff --git a/spa/include/spa/pod/parser.h b/spa/include/spa/pod/parser.h index 9c128f26a..f049af006 100644 --- a/spa/include/spa/pod/parser.h +++ b/spa/include/spa/pod/parser.h @@ -80,8 +80,13 @@ spa_pod_parser_deref(struct spa_pod_parser *parser, uint32_t offset, uint32_t si * to the next multiple of 8) is in bounds. */ if (SPA_IS_ALIGNED(pod, SPA_POD_ALIGN) && - long_offset + SPA_ROUND_UP_N((uint64_t)SPA_POD_BODY_SIZE(pod), SPA_POD_ALIGN) <= size) - return (struct spa_pod *)pod; + long_offset + SPA_ROUND_UP_N((uint64_t)SPA_POD_BODY_SIZE(pod), SPA_POD_ALIGN) <= size) { + uint64_t zero = 0; + size_t padding = SPA_POD_BODY_SIZE(pod) & 7; + if (padding == 0 || + memcmp(SPA_PTROFF(pod, SPA_POD_SIZE(pod), void), &zero, 8 - padding) == 0) + return (struct spa_pod *)pod; + } } return NULL; }