Skip to content

Commit ed58819

Browse files
committed
Check that auxiliary tracks have 'auxv' as the handler_type
According to the HEIF specification, auxiliary tracks should have 'auxv' as the handler_type. Update the existing findAuxlTracks logic to check for that and then perform the 'auxi' check only on those tracks which have the handler_type as 'auxi'. Fixes issue #38.
1 parent 1057c3e commit ed58819

11 files changed

+27
-11
lines changed

src/specs/heif/heif.cpp

+6-1
Original file line numberDiff line numberDiff line change
@@ -199,8 +199,13 @@ static const SpecDesc specHeif =
199199
trackId = (uint32_t)sym.value;
200200
}
201201

202-
if(handlerType == FOURCC("pict") && trackId)
202+
if(trackId)
203203
{
204+
if(handlerType != FOURCC("auxv"))
205+
{
206+
out->error("Found 'auxl' track (id: %u) with unexpected handler_type. Must be 'auxv'.", trackId);
207+
}
208+
204209
auto id = findTrackId(moovChild);
205210

206211
if(id)

src/specs/miaf/miaf.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -1391,7 +1391,7 @@ std::initializer_list<RuleDesc> rulesMiafGeneral =
13911391
trackId = (uint32_t)sym.value;
13921392
}
13931393

1394-
if(handlerType == FOURCC("pict") && trackId)
1394+
if(handlerType == FOURCC("auxv") && trackId)
13951395
{
13961396
auto id = findTrackId(moovChild);
13971397

tests/avif/invalid-avis-pict.ref

+11-1
Original file line numberDiff line numberDiff line change
@@ -66,22 +66,32 @@ displayable (not hidden)
6666

6767
Specification description: HEIF - ISO/IEC 23008-12 - 2nd Edition N18310
6868

69+
[heif][Rule #1] Error: Found 'auxl' track (id: 1) with unexpected handler_type. Must be 'auxv'.
6970
[heif][Rule #3] Error: The handler type for the MetaBox shall be 'pict'
7071
[heif][Rule #32] Error: 'mif1' brand: this file shall conform to HEIF section 6, check the other errors for details
72+
[heif][Rule #33] Error: 'msf1' brand: this file shall conform to HEIF section 7, check the other errors for details
7173

7274
========================================
73-
[heif] 2 error(s), 0 warning(s).
75+
[heif] 4 error(s), 0 warning(s).
7476
========================================
7577

7678
===== Involved rules descriptions:
7779

80+
[heif][Rule #1] Section 7.5.3.1
81+
The nature of the auxiliary track is announced by the AuxiliaryTypeInfoBox that
82+
shall be included in the sample entry of the auxiliary track.
83+
7884
[heif][Rule #3] Section 6.2
7985
The handler type for the MetaBox shall be 'pict'.
8086

8187
[heif][Rule #32] Section 10.2
8288
when a brand specified in 10.2 is among the compatible brands of a file,
8389
the requirements specified in Clause 6 shall be obeyed
8490

91+
[heif][Rule #33] Section 10.3
92+
when a brand specified in 10.3 is among the compatible brands of a file,
93+
the requirements specified in Clause 7 shall be obeyed
94+
8595
+--------------------------------------+
8696
| isobmff validation |
8797
+--------------------------------------+

tests/heif/invalid-auxl-auxi.ref

+2-1
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,12 @@
44

55
Specification description: HEIF - ISO/IEC 23008-12 - 2nd Edition N18310
66

7+
[heif][Rule #1] Error: Found 'auxl' track (id: 1) with unexpected handler_type. Must be 'auxv'.
78
[heif][Rule #1] Error: AuxiliaryTypeInfoBox ('auxi') is absent (trackIDs: video=1, aux=2)
89
[heif][Rule #33] Error: 'msf1' brand: this file shall conform to HEIF section 7, check the other errors for details
910

1011
========================================
11-
[heif] 2 error(s), 0 warning(s).
12+
[heif] 3 error(s), 0 warning(s).
1213
========================================
1314

1415
===== Involved rules descriptions:

tests/heif/invalid-brand-msf1.asm

+1-1
Original file line numberDiff line numberDiff line change
@@ -504,7 +504,7 @@ moov_start:
504504
db 0x00 ; "version(8)"
505505
db 0x00, 0x00, 0x00 ; "flags(24)"
506506
db 0x00, 0x00, 0x00, 0x00 ; "pre_defined(32)"
507-
db 0x70, 0x69, 0x63, 0x74 ; "handler_type(32)" ('pict')
507+
db 0x61, 0x75, 0x78, 0x76 ; "handler_type(32)" ('auxv')
508508
db 0x00, 0x00, 0x00, 0x00 ; "reserved1(32)"
509509
db 0x00, 0x00, 0x00, 0x00 ; "reserved2(32)"
510510
db 0x00, 0x00, 0x00, 0x00 ; "reserved3(32)"

tests/heif/valid-auxl-auxi.asm

+1-1
Original file line numberDiff line numberDiff line change
@@ -503,7 +503,7 @@ moov_start:
503503
db 0x00 ; "version(8)"
504504
db 0x00, 0x00, 0x00 ; "flags(24)"
505505
db 0x00, 0x00, 0x00, 0x00 ; "pre_defined(32)"
506-
db 0x70, 0x69, 0x63, 0x74 ; "handler_type(32)" ('pict')
506+
db 0x61, 0x75, 0x78, 0x76 ; "handler_type(32)" ('auxv')
507507
db 0x00, 0x00, 0x00, 0x00 ; "reserved1(32)"
508508
db 0x00, 0x00, 0x00, 0x00 ; "reserved2(32)"
509509
db 0x00, 0x00, 0x00, 0x00 ; "reserved3(32)"

tests/heif/valid-brand-msf1.asm

+1-1
Original file line numberDiff line numberDiff line change
@@ -504,7 +504,7 @@ moov_start:
504504
db 0x00 ; "version(8)"
505505
db 0x00, 0x00, 0x00 ; "flags(24)"
506506
db 0x00, 0x00, 0x00, 0x00 ; "pre_defined(32)"
507-
db 0x70, 0x69, 0x63, 0x74 ; "handler_type(32)" ('pict')
507+
db 0x61, 0x75, 0x78, 0x76 ; "handler_type(32)" ('auxv')
508508
db 0x00, 0x00, 0x00, 0x00 ; "reserved1(32)"
509509
db 0x00, 0x00, 0x00, 0x00 ; "reserved2(32)"
510510
db 0x00, 0x00, 0x00, 0x00 ; "reserved3(32)"

tests/heif/valid-multiple-extents.asm

+1-1
Original file line numberDiff line numberDiff line change
@@ -504,7 +504,7 @@ moov_start:
504504
db 0x00 ; "version(8)"
505505
db 0x00, 0x00, 0x00 ; "flags(24)"
506506
db 0x00, 0x00, 0x00, 0x00 ; "pre_defined(32)"
507-
db 0x70, 0x69, 0x63, 0x74 ; "handler_type(32)" ('pict')
507+
db 0x61, 0x75, 0x78, 0x76 ; "handler_type(32)" ('auxv')
508508
db 0x00, 0x00, 0x00, 0x00 ; "reserved1(32)"
509509
db 0x00, 0x00, 0x00, 0x00 ; "reserved2(32)"
510510
db 0x00, 0x00, 0x00, 0x00 ; "reserved3(32)"

tests/miaf/invalid-alpha-track-composition-times.asm

+1-1
Original file line numberDiff line numberDiff line change
@@ -511,7 +511,7 @@ moov_start:
511511
db 0x00 ; "version(8)"
512512
db 0x00, 0x00, 0x00 ; "flags(24)"
513513
db 0x00, 0x00, 0x00, 0x00 ; "pre_defined(32)"
514-
db 0x70, 0x69, 0x63, 0x74 ; "handler_type(32)" ('pict')
514+
db 0x61, 0x75, 0x78, 0x76 ; "handler_type(32)" ('auxv')
515515
db 0x00, 0x00, 0x00, 0x00 ; "reserved1(32)"
516516
db 0x00, 0x00, 0x00, 0x00 ; "reserved2(32)"
517517
db 0x00, 0x00, 0x00, 0x00 ; "reserved3(32)"

tests/miaf/invalid-pixi-displayable.asm

+1-1
Original file line numberDiff line numberDiff line change
@@ -503,7 +503,7 @@ moov_start:
503503
db 0x00 ; "version(8)"
504504
db 0x00, 0x00, 0x00 ; "flags(24)"
505505
db 0x00, 0x00, 0x00, 0x00 ; "pre_defined(32)"
506-
db 0x70, 0x69, 0x63, 0x74 ; "handler_type(32)" ('pict')
506+
db 0x61, 0x75, 0x78, 0x76 ; "handler_type(32)" ('pict')
507507
db 0x00, 0x00, 0x00, 0x00 ; "reserved1(32)"
508508
db 0x00, 0x00, 0x00, 0x00 ; "reserved2(32)"
509509
db 0x00, 0x00, 0x00, 0x00 ; "reserved3(32)"

tests/miaf/valid-alpha-track-composition-times.asm

+1-1
Original file line numberDiff line numberDiff line change
@@ -503,7 +503,7 @@ moov_start:
503503
db 0x00 ; "version(8)"
504504
db 0x00, 0x00, 0x00 ; "flags(24)"
505505
db 0x00, 0x00, 0x00, 0x00 ; "pre_defined(32)"
506-
db 0x70, 0x69, 0x63, 0x74 ; "handler_type(32)" ('pict')
506+
db 0x61, 0x75, 0x78, 0x76 ; "handler_type(32)" ('auxv')
507507
db 0x00, 0x00, 0x00, 0x00 ; "reserved1(32)"
508508
db 0x00, 0x00, 0x00, 0x00 ; "reserved2(32)"
509509
db 0x00, 0x00, 0x00, 0x00 ; "reserved3(32)"

0 commit comments

Comments
 (0)