variant: strip initial tuple offset before aligning
We set the initial tuple size to 1, so we do not falsly treat it as
empty. However, when we notice that the tuple is non-empty, we must
strip this offset *before* aligning the first child.
@@ -170,10 +170,10 @@ long dbus_variant_type_new_from_signature(DBusVariantType **infop,
if (depth > 0) {
if (container->size && this->size) {
- container->size = C_ALIGN_TO(container->size, 1 << this->alignment);
- container->size += this->size;
/* subtract initializer */
container->size -= (this == container + 1);
+ container->size = C_ALIGN_TO(container->size, 1 << this->alignment);
+ container->size += this->size;
} else {
container->size = 0;
}
