Skip to content

numInputImageItems to avifImageApplyExpression32b#2986

Open
wantehchang wants to merge 1 commit intoAOMediaCodec:mainfrom
wantehchang:pass-numInputImageItems
Open

numInputImageItems to avifImageApplyExpression32b#2986
wantehchang wants to merge 1 commit intoAOMediaCodec:mainfrom
wantehchang:pass-numInputImageItems

Conversation

@wantehchang
Copy link
Collaborator

Pass numInputImageItems (the size of the inputImageItems array) to avifImageApplyExpression32b(). Validate the index for the inputImageItems array.

Pass numInputImageItems (the size of the inputImageItems array) to
avifImageApplyExpression32b(). Validate the index for the
inputImageItems array.
} else if (token->type == AVIF_SAMPLE_TRANSFORM_INPUT_IMAGE_ITEM_INDEX) {
const avifImage * image = inputImageItems[token->inputImageItemIndex - 1]; // 1-based
// inputImageItemIndex is 1-based.
const uint8_t zeroBasedIndex = token->inputImageItemIndex - 1;
Copy link
Contributor

Choose a reason for hiding this comment

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

There is absolutely no way inputImageItemIndex is 0 I guess?

Copy link
Contributor

Choose a reason for hiding this comment

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

Indeed. It is checked in avifSampleTransformExpressionIsValid(), but so is inputImageItemIndex <= numInputImageItems.

} else if (token->type == AVIF_SAMPLE_TRANSFORM_INPUT_IMAGE_ITEM_INDEX) {
const avifImage * image = inputImageItems[token->inputImageItemIndex - 1]; // 1-based
// inputImageItemIndex is 1-based.
const uint8_t zeroBasedIndex = token->inputImageItemIndex - 1;
Copy link
Contributor

Choose a reason for hiding this comment

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

Indeed. It is checked in avifSampleTransformExpressionIsValid(), but so is inputImageItemIndex <= numInputImageItems.

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.

3 participants