Skip to content

Commit

Permalink
Also check the type "skip" for a FreeSpaceBox
Browse files Browse the repository at this point in the history
The type of a FreeSpaceBox can be "free" or "skip".

A follow-up to AOMediaCodec#2398.
  • Loading branch information
wantehchang committed Aug 22, 2024
1 parent 9be2966 commit a357f29
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/read.c
Original file line number Diff line number Diff line change
Expand Up @@ -4153,7 +4153,8 @@ static avifResult avifParse(avifDecoder * decoder)
}
#endif

if (!isFtyp && (isNonSkippableVariableLengthBox || !memcmp(header.type, "free", 4) || !memcmp(header.type, "mdat", 4))) {
if (!isFtyp && (isNonSkippableVariableLengthBox || !memcmp(header.type, "free", 4) || !memcmp(header.type, "skip", 4) ||
!memcmp(header.type, "mdat", 4))) {
// Section 6.3.4 of ISO/IEC 14496-12:
// The FileTypeBox shall occur before any variable-length box (e.g. movie, free space, media data).
AVIF_CHECKERR(ftypSeen, AVIF_RESULT_BMFF_PARSE_FAILED);
Expand Down

0 comments on commit a357f29

Please sign in to comment.