Skip to content

Conversation

@wantehchang
Copy link
Collaborator

If alphaItemCodecConfigSize is equal to 0, alphaItemCodecConfig is invalid (zero-initialized) and should not be used. This matches the similar code for the gain map item.

Related to bug b:472695059.

If alphaItemCodecConfigSize is equal to 0, alphaItemCodecConfig is
invalid (zero-initialized) and should not be used. This matches the
similar code for the gain map item.

Related to bug b:472695059.
@wantehchang wantehchang requested a review from y-guyon January 3, 2026 02:09
AVIF_CHECKERR(avifDecoderItemAddProperty(alphaItem, alphaCodecConfigProp), AVIF_RESULT_OUT_OF_MEMORY);
} else {
AVIF_CHECKERR(avifMetaCreateProperty(meta, "skip"), AVIF_RESULT_OUT_OF_MEMORY); // Placeholder.
}
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The similar code for the gain map item is at lines 4512-4520:

    if (gainmapItemCodecConfigSize != 0) {
        // Property with fixed index 17.
        avifProperty * gainmapCodecConfigProp = avifMetaCreateProperty(meta, (const char *)codecConfigType);
        AVIF_CHECKERR(gainmapCodecConfigProp, AVIF_RESULT_OUT_OF_MEMORY);
        gainmapCodecConfigProp->u.av1C = gainmapItemCodecConfig;
        AVIF_CHECKERR(avifDecoderItemAddProperty(gainmapItem, gainmapCodecConfigProp), AVIF_RESULT_OUT_OF_MEMORY);
    } else {
        AVIF_CHECKERR(avifMetaCreateProperty(meta, "skip"), AVIF_RESULT_OUT_OF_MEMORY); // Placeholder.
    }

@wantehchang wantehchang merged commit 3533b33 into AOMediaCodec:main Jan 5, 2026
21 checks passed
@wantehchang wantehchang deleted the change-related-to-buganizer-472695059 branch January 5, 2026 21:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants