-
Notifications
You must be signed in to change notification settings - Fork 204
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
Bail out of avifDecoderParse() if an essential-required item property is not flagged as essential #537
base: main
Are you sure you want to change the base?
Conversation
… is not flagged as essential
src/read.c
Outdated
// types in this list are *required* in the spec to be flagged as essential when | ||
// associated with an item. | ||
static const char * essentialTypes[] = { | ||
"av1C" // AVIF: Section 2.2.1: "This property shall be marked as essential." |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"av1C" // AVIF: Section 2.2.1: "This property shall be marked as essential." | |
"av1C" // AVIF: Section 2.2.1: "This property shall be marked as essential." | |
"a1op" // AVIF: Section 2.3.2.1: "If associated, it shall be marked as essential." |
Not sure if a1op
needs to be handled differently here.
Also, should there be an opposite check for a1lx
since the spec says "If associated, it shall not be marked as essential"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm. I'm thinking about removing lsel
from the list for now and just adding boxes to this list as I add support for new boxes. lsel
isn't written or read at all right now, so it seems odd to preemptively block a read on it.
One issue with this is any file created with a sufficiently old This means I have to fix the IO data checked into |
I see. Let's also check the AVIF encoder in libheif. |
The libheif function to inspect is
The relevant libheif code is in libheif/heif_file.cc:
The code was originally added in this commit, with So the AVIF encoder in libheif marks av1C as essential. |
I've submitted a PR to |
I think this is a good change in the longrun, but I admit to being a bit concerned that there will be some "old" AVIFs (generated with avifenc prior to Perhaps before rolling this out (or alongside it), we should offer some kind of cheap fixup tool that toggles the correct essential bit in "old" files? |
Related: AOMediaCodec/libavif#537 Co-authored-by: Joe Drago <[email protected]>
I've created a standalone script to fix old AVIFs with this issue. Should I check this into libavif somewhere? |
This should ensure that all
av1C
property associations are flagged asessential
.@wantehchang @cconcolato are there other properties we should enforce this way, while we're at it?