Unsupported data can be removed, which reallocated the custom data layer array. Since the temporary ID vectors referenced memory in that array directly, this could lead to a use-after-free. Instead remove unsupported data before collecting the referenced attribute IDs.