Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Check avifAlloc() result in avifArrayPush*() #1694

Merged
merged 1 commit into from
Oct 19, 2023

Conversation

y-guyon
Copy link
Collaborator

@y-guyon y-guyon commented Oct 19, 2023

Propagate avifResult to call sites.
Remove unused avifArrayPushIndex() and avifArrayPush().
Rename avifArrayPushPtr() to avifArrayPush().
Rename avifMetaFindItem() to avifMetaFindOrCreateItem().
Fix iref checking item ID != 0 too late.
Add entry to CHANGELOG.md.

See #820.

Propagate avifResult to call sites.
Remove unused avifArrayPushIndex() and avifArrayPush().
Rename avifArrayPushPtr() to avifArrayPush().
Rename avifMetaFindItem() to avifMetaFindOrCreateItem().
Fix "iref" checking item ID != 0 too late.
Add entry to CHANGELOG.md.
Copy link
Collaborator

@vrabaud vrabaud left a comment

Choose a reason for hiding this comment

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

line 2557 is for "Fix iref checking item ID != 0 too late." right?

@y-guyon
Copy link
Collaborator Author

y-guyon commented Oct 19, 2023

line 2557 is for "Fix iref checking item ID != 0 too late." right?

No, line 2640.
In avifParseItemReferenceBox(), avifROStreamReadU16/32() is used to read an item ID.
Previously, avifMetaFindItem() was checking for id!=0. I split that function into avifCheckItemID() and avifMetaFindOrCreateItem().
avifMetaFindItem() was called only if fromID && toID, ignoring id==0 rather than returning an error. Moving avifCheckItemID() closer to avifROStreamReadU16/32() changed the behavior.

@y-guyon y-guyon merged commit 1fbea62 into AOMediaCodec:main Oct 19, 2023
17 checks passed
@y-guyon y-guyon deleted the avifalloc_arraypush branch October 19, 2023 08:29
fdintino added a commit to fdintino/pillow-avif-plugin that referenced this pull request Nov 9, 2023
The invalid item ID in the iref box throws an error when decoded in
libavif since AOMediaCodec/libavif#1694
fdintino added a commit to fdintino/pillow-avif-plugin that referenced this pull request Nov 9, 2023
The invalid item ID in the iref box throws an error when decoded in
libavif since AOMediaCodec/libavif#1694
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