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

Remove check that the meta box is zero when searching for a tmap. #2431

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 1 addition & 8 deletions src/read.c
Original file line number Diff line number Diff line change
Expand Up @@ -4091,7 +4091,6 @@ static avifResult avifParse(avifDecoder * decoder)
avifDecoderData * data = decoder->data;
avifBool ftypSeen = AVIF_FALSE;
avifBool metaSeen = AVIF_FALSE;
avifBool metaIsSizeZero = AVIF_FALSE;
avifBool moovSeen = AVIF_FALSE;
avifBool needsMeta = AVIF_FALSE;
avifBool needsMoov = AVIF_FALSE;
Expand Down Expand Up @@ -4140,7 +4139,6 @@ static avifResult avifParse(avifDecoder * decoder)
} else if (!memcmp(header.type, "meta", 4)) {
isMeta = AVIF_TRUE;
isNonSkippableVariableLengthBox = AVIF_TRUE;
metaIsSizeZero = header.isSizeZeroBox;
} else if (!memcmp(header.type, "moov", 4)) {
isMoov = AVIF_TRUE;
isNonSkippableVariableLengthBox = AVIF_TRUE;
Expand Down Expand Up @@ -4276,9 +4274,6 @@ static avifResult avifParse(avifDecoder * decoder)
avifBool sawEverythingNeeded = ftypSeen && (!needsMeta || metaSeen) && (!needsMoov || moovSeen);
#if defined(AVIF_ENABLE_EXPERIMENTAL_MINI)
sawEverythingNeeded = sawEverythingNeeded && (!needsMini || miniSeen);
#endif
#if defined(AVIF_ENABLE_EXPERIMENTAL_GAIN_MAP)
sawEverythingNeeded = sawEverythingNeeded && (!needsTmap || tmapSeen);
#endif
if (sawEverythingNeeded) {
return AVIF_RESULT_OK;
Expand All @@ -4292,10 +4287,8 @@ static avifResult avifParse(avifDecoder * decoder)
}
#if defined(AVIF_ENABLE_EXPERIMENTAL_GAIN_MAP)
if (needsTmap && !tmapSeen) {
return metaIsSizeZero ? AVIF_RESULT_TRUNCATED_DATA : AVIF_RESULT_BMFF_PARSE_FAILED;
Copy link
Collaborator

Choose a reason for hiding this comment

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

I do not why that check was only present for tmap in the first place.

return AVIF_RESULT_BMFF_PARSE_FAILED;
}
#else
(void)metaIsSizeZero;
#endif
#if defined(AVIF_ENABLE_EXPERIMENTAL_MINI)
if (needsMini && !miniSeen) {
Expand Down
Loading