Skip to content

Commit

Permalink
heif: fix early exit in test on ispe coming before transform properti…
Browse files Browse the repository at this point in the history
…es - fix #59
  • Loading branch information
rbouqueau committed Apr 30, 2023
1 parent 430fe46 commit 2cf3f50
Show file tree
Hide file tree
Showing 10 changed files with 50 additions and 48 deletions.
5 changes: 1 addition & 4 deletions src/specs/heif/heif.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -783,11 +783,8 @@ static const SpecDesc specHeif =
else
{
if(properties[sym.value - 1] == FOURCC("ispe"))
{
foundIspe = true;
break;
}
else if(isTransformative(properties[sym.value - 1]))
else if(isTransformative(properties[sym.value - 1]) && !foundIspe) // Romain => ON NE CHECKE PAS SI C'EST UNE IMAGE!!!!
out->error("Item ID=%u: transformative property \"%s\" (index=%lld) found prior to \"ispe\"",
localItemId, toString(properties[sym.value - 1]).c_str(), sym.value);
}
Expand Down
6 changes: 5 additions & 1 deletion tests/heif/invalid-ispe-property-order.asm
Original file line number Diff line number Diff line change
Expand Up @@ -57,11 +57,15 @@ dd BE(ipma_end - ipma_start)
dd "ipma"
db 0x00 ; version(8)
db 0x00, 0x00, 0x00 ; flags(24)
db 0x00, 0x00, 0x00, 0x01 ; entry_count(32)
db 0x00, 0x00, 0x00, 0x02 ; entry_count(32)
db 0x00, 0x01 ; item_ID(16)
db 0x02 ; association_count(8)
db 0x02 ; essential(1) property_index(7)
db 0x01 ; essential(1) property_index(7)
db 0x00, 0x02 ; item_ID(16)
db 0x02 ; association_count(8)
db 0x02 ; essential(1) property_index(7)
db 0x01 ; essential(1) property_index(7)
ipma_end:
iprp_end:

Expand Down
3 changes: 2 additions & 1 deletion tests/heif/invalid-ispe-property-order.ref
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,12 @@
Specification description: HEIF - ISO/IEC 23008-12 - 2nd Edition N18310

[heif][Rule #11] Error: Item ID=1: transformative property "imir" (index=2) found prior to "ispe"
[heif][Rule #11] Error: Item ID=2: transformative property "imir" (index=2) found prior to "ispe"
[heif][Rule #14] Error: No primary item.
[heif][Rule #32] Error: 'mif1' brand: this file shall conform to HEIF section 6, check the other errors for details

========================================
[heif] 3 error(s), 0 warning(s).
[heif] 4 error(s), 0 warning(s).
========================================

===== Involved rules descriptions:
Expand Down
12 changes: 6 additions & 6 deletions tests/miaf/invalid-colours-av1-420.asm
Original file line number Diff line number Diff line change
Expand Up @@ -305,43 +305,43 @@ meta_start:
db 0x86 ; essential(1) property_index(7)
db 0x00, 0x02 ; item_ID(16)
db 0x05 ; association_count(8)
db 0x82 ; essential(1) property_index(7)
db 0x03 ; essential(1) property_index(7)
db 0x82 ; essential(1) property_index(7)
db 0x04 ; essential(1) property_index(7)
db 0x85 ; essential(1) property_index(7)
db 0x86 ; essential(1) property_index(7)
db 0x00, 0x03 ; item_ID(16)
db 0x05 ; association_count(8)
db 0x82 ; essential(1) property_index(7)
db 0x03 ; essential(1) property_index(7)
db 0x82 ; essential(1) property_index(7)
db 0x04 ; essential(1) property_index(7)
db 0x85 ; essential(1) property_index(7)
db 0x86 ; essential(1) property_index(7)
db 0x00, 0x04 ; item_ID(16)
db 0x05 ; association_count(8)
db 0x82 ; essential(1) property_index(7)
db 0x03 ; essential(1) property_index(7)
db 0x82 ; essential(1) property_index(7)
db 0x04 ; essential(1) property_index(7)
db 0x85 ; essential(1) property_index(7)
db 0x86 ; essential(1) property_index(7)
db 0x00, 0x05 ; item_ID(16)
db 0x05 ; association_count(8)
db 0x82 ; essential(1) property_index(7)
db 0x03 ; essential(1) property_index(7)
db 0x82 ; essential(1) property_index(7)
db 0x04 ; essential(1) property_index(7)
db 0x85 ; essential(1) property_index(7)
db 0x86 ; essential(1) property_index(7)
db 0x00, 0x06 ; item_ID(16)
db 0x05 ; association_count(8)
db 0x82 ; essential(1) property_index(7)
db 0x03 ; essential(1) property_index(7)
db 0x82 ; essential(1) property_index(7)
db 0x04 ; essential(1) property_index(7)
db 0x85 ; essential(1) property_index(7)
db 0x86 ; essential(1) property_index(7)
db 0x00, 0x07 ; item_ID(16)
db 0x05 ; association_count(8)
db 0x82 ; essential(1) property_index(7)
db 0x03 ; essential(1) property_index(7)
db 0x82 ; essential(1) property_index(7)
db 0x04 ; essential(1) property_index(7)
db 0x85 ; essential(1) property_index(7)
db 0x86 ; essential(1) property_index(7)
Expand Down
12 changes: 6 additions & 6 deletions tests/miaf/invalid-colours-av1-422.asm
Original file line number Diff line number Diff line change
Expand Up @@ -305,43 +305,43 @@ meta_start:
db 0x86 ; essential(1) property_index(7)
db 0x00, 0x02 ; item_ID(16)
db 0x05 ; association_count(8)
db 0x03 ; essential(1) property_index(7)
db 0x82 ; essential(1) property_index(7)
db 0x03 ; essential(1) property_index(7)
db 0x04 ; essential(1) property_index(7)
db 0x85 ; essential(1) property_index(7)
db 0x86 ; essential(1) property_index(7)
db 0x00, 0x03 ; item_ID(16)
db 0x05 ; association_count(8)
db 0x82 ; essential(1) property_index(7)
db 0x03 ; essential(1) property_index(7)
db 0x82 ; essential(1) property_index(7)
db 0x04 ; essential(1) property_index(7)
db 0x85 ; essential(1) property_index(7)
db 0x86 ; essential(1) property_index(7)
db 0x00, 0x04 ; item_ID(16)
db 0x05 ; association_count(8)
db 0x82 ; essential(1) property_index(7)
db 0x03 ; essential(1) property_index(7)
db 0x82 ; essential(1) property_index(7)
db 0x04 ; essential(1) property_index(7)
db 0x85 ; essential(1) property_index(7)
db 0x86 ; essential(1) property_index(7)
db 0x00, 0x05 ; item_ID(16)
db 0x05 ; association_count(8)
db 0x82 ; essential(1) property_index(7)
db 0x03 ; essential(1) property_index(7)
db 0x82 ; essential(1) property_index(7)
db 0x04 ; essential(1) property_index(7)
db 0x85 ; essential(1) property_index(7)
db 0x86 ; essential(1) property_index(7)
db 0x00, 0x06 ; item_ID(16)
db 0x05 ; association_count(8)
db 0x03 ; essential(1) property_index(7)
db 0x82 ; essential(1) property_index(7)
db 0x03 ; essential(1) property_index(7)
db 0x04 ; essential(1) property_index(7)
db 0x85 ; essential(1) property_index(7)
db 0x86 ; essential(1) property_index(7)
db 0x00, 0x07 ; item_ID(16)
db 0x05 ; association_count(8)
db 0x82 ; essential(1) property_index(7)
db 0x03 ; essential(1) property_index(7)
db 0x82 ; essential(1) property_index(7)
db 0x04 ; essential(1) property_index(7)
db 0x85 ; essential(1) property_index(7)
db 0x86 ; essential(1) property_index(7)
Expand Down
12 changes: 6 additions & 6 deletions tests/miaf/invalid-colours-avc-not-supported-avc.asm
Original file line number Diff line number Diff line change
Expand Up @@ -305,43 +305,43 @@ meta_start:
db 0x86 ; essential(1) property_index(7)
db 0x00, 0x02 ; item_ID(16)
db 0x05 ; association_count(8)
db 0x82 ; essential(1) property_index(7)
db 0x03 ; essential(1) property_index(7)
db 0x82 ; essential(1) property_index(7)
db 0x04 ; essential(1) property_index(7)
db 0x85 ; essential(1) property_index(7)
db 0x86 ; essential(1) property_index(7)
db 0x00, 0x03 ; item_ID(16)
db 0x05 ; association_count(8)
db 0x82 ; essential(1) property_index(7)
db 0x03 ; essential(1) property_index(7)
db 0x82 ; essential(1) property_index(7)
db 0x04 ; essential(1) property_index(7)
db 0x85 ; essential(1) property_index(7)
db 0x86 ; essential(1) property_index(7)
db 0x00, 0x04 ; item_ID(16)
db 0x05 ; association_count(8)
db 0x82 ; essential(1) property_index(7)
db 0x03 ; essential(1) property_index(7)
db 0x82 ; essential(1) property_index(7)
db 0x04 ; essential(1) property_index(7)
db 0x85 ; essential(1) property_index(7)
db 0x86 ; essential(1) property_index(7)
db 0x00, 0x05 ; item_ID(16)
db 0x05 ; association_count(8)
db 0x82 ; essential(1) property_index(7)
db 0x03 ; essential(1) property_index(7)
db 0x82 ; essential(1) property_index(7)
db 0x04 ; essential(1) property_index(7)
db 0x85 ; essential(1) property_index(7)
db 0x86 ; essential(1) property_index(7)
db 0x00, 0x06 ; item_ID(16)
db 0x05 ; association_count(8)
db 0x82 ; essential(1) property_index(7)
db 0x03 ; essential(1) property_index(7)
db 0x82 ; essential(1) property_index(7)
db 0x04 ; essential(1) property_index(7)
db 0x85 ; essential(1) property_index(7)
db 0x86 ; essential(1) property_index(7)
db 0x00, 0x07 ; item_ID(16)
db 0x05 ; association_count(8)
db 0x82 ; essential(1) property_index(7)
db 0x03 ; essential(1) property_index(7)
db 0x82 ; essential(1) property_index(7)
db 0x04 ; essential(1) property_index(7)
db 0x85 ; essential(1) property_index(7)
db 0x86 ; essential(1) property_index(7)
Expand Down
12 changes: 6 additions & 6 deletions tests/miaf/invalid-colours.asm
Original file line number Diff line number Diff line change
Expand Up @@ -305,43 +305,43 @@ meta_start:
db 0x86 ; essential(1) property_index(7)
db 0x00, 0x02 ; item_ID(16)
db 0x05 ; association_count(8)
db 0x82 ; essential(1) property_index(7)
db 0x03 ; essential(1) property_index(7)
db 0x82 ; essential(1) property_index(7)
db 0x04 ; essential(1) property_index(7)
db 0x85 ; essential(1) property_index(7)
db 0x86 ; essential(1) property_index(7)
db 0x00, 0x03 ; item_ID(16)
db 0x05 ; association_count(8)
db 0x82 ; essential(1) property_index(7)
db 0x03 ; essential(1) property_index(7)
db 0x82 ; essential(1) property_index(7)
db 0x04 ; essential(1) property_index(7)
db 0x85 ; essential(1) property_index(7)
db 0x86 ; essential(1) property_index(7)
db 0x00, 0x04 ; item_ID(16)
db 0x05 ; association_count(8)
db 0x82 ; essential(1) property_index(7)
db 0x03 ; essential(1) property_index(7)
db 0x82 ; essential(1) property_index(7)
db 0x04 ; essential(1) property_index(7)
db 0x85 ; essential(1) property_index(7)
db 0x86 ; essential(1) property_index(7)
db 0x00, 0x05 ; item_ID(16)
db 0x05 ; association_count(8)
db 0x82 ; essential(1) property_index(7)
db 0x03 ; essential(1) property_index(7)
db 0x82 ; essential(1) property_index(7)
db 0x04 ; essential(1) property_index(7)
db 0x85 ; essential(1) property_index(7)
db 0x86 ; essential(1) property_index(7)
db 0x00, 0x06 ; item_ID(16)
db 0x05 ; association_count(8)
db 0x82 ; essential(1) property_index(7)
db 0x03 ; essential(1) property_index(7)
db 0x82 ; essential(1) property_index(7)
db 0x04 ; essential(1) property_index(7)
db 0x85 ; essential(1) property_index(7)
db 0x86 ; essential(1) property_index(7)
db 0x00, 0x07 ; item_ID(16)
db 0x05 ; association_count(8)
db 0x82 ; essential(1) property_index(7)
db 0x03 ; essential(1) property_index(7)
db 0x82 ; essential(1) property_index(7)
db 0x04 ; essential(1) property_index(7)
db 0x85 ; essential(1) property_index(7)
db 0x86 ; essential(1) property_index(7)
Expand Down
12 changes: 6 additions & 6 deletions tests/miaf/valid-colours-av1-420.asm
Original file line number Diff line number Diff line change
Expand Up @@ -305,43 +305,43 @@ meta_start:
db 0x86 ; essential(1) property_index(7)
db 0x00, 0x02 ; item_ID(16)
db 0x05 ; association_count(8)
db 0x82 ; essential(1) property_index(7)
db 0x03 ; essential(1) property_index(7)
db 0x82 ; essential(1) property_index(7)
db 0x04 ; essential(1) property_index(7)
db 0x85 ; essential(1) property_index(7)
db 0x86 ; essential(1) property_index(7)
db 0x00, 0x03 ; item_ID(16)
db 0x05 ; association_count(8)
db 0x82 ; essential(1) property_index(7)
db 0x03 ; essential(1) property_index(7)
db 0x82 ; essential(1) property_index(7)
db 0x04 ; essential(1) property_index(7)
db 0x85 ; essential(1) property_index(7)
db 0x86 ; essential(1) property_index(7)
db 0x00, 0x04 ; item_ID(16)
db 0x05 ; association_count(8)
db 0x82 ; essential(1) property_index(7)
db 0x03 ; essential(1) property_index(7)
db 0x82 ; essential(1) property_index(7)
db 0x04 ; essential(1) property_index(7)
db 0x85 ; essential(1) property_index(7)
db 0x86 ; essential(1) property_index(7)
db 0x00, 0x05 ; item_ID(16)
db 0x05 ; association_count(8)
db 0x82 ; essential(1) property_index(7)
db 0x03 ; essential(1) property_index(7)
db 0x82 ; essential(1) property_index(7)
db 0x04 ; essential(1) property_index(7)
db 0x85 ; essential(1) property_index(7)
db 0x86 ; essential(1) property_index(7)
db 0x00, 0x06 ; item_ID(16)
db 0x05 ; association_count(8)
db 0x82 ; essential(1) property_index(7)
db 0x03 ; essential(1) property_index(7)
db 0x82 ; essential(1) property_index(7)
db 0x04 ; essential(1) property_index(7)
db 0x85 ; essential(1) property_index(7)
db 0x86 ; essential(1) property_index(7)
db 0x00, 0x07 ; item_ID(16)
db 0x05 ; association_count(8)
db 0x82 ; essential(1) property_index(7)
db 0x03 ; essential(1) property_index(7)
db 0x82 ; essential(1) property_index(7)
db 0x04 ; essential(1) property_index(7)
db 0x85 ; essential(1) property_index(7)
db 0x86 ; essential(1) property_index(7)
Expand Down
12 changes: 6 additions & 6 deletions tests/miaf/valid-colours-av1-422.asm
Original file line number Diff line number Diff line change
Expand Up @@ -305,43 +305,43 @@ meta_start:
db 0x86 ; essential(1) property_index(7)
db 0x00, 0x02 ; item_ID(16)
db 0x05 ; association_count(8)
db 0x82 ; essential(1) property_index(7)
db 0x03 ; essential(1) property_index(7)
db 0x82 ; essential(1) property_index(7)
db 0x04 ; essential(1) property_index(7)
db 0x85 ; essential(1) property_index(7)
db 0x86 ; essential(1) property_index(7)
db 0x00, 0x03 ; item_ID(16)
db 0x05 ; association_count(8)
db 0x82 ; essential(1) property_index(7)
db 0x03 ; essential(1) property_index(7)
db 0x82 ; essential(1) property_index(7)
db 0x04 ; essential(1) property_index(7)
db 0x85 ; essential(1) property_index(7)
db 0x86 ; essential(1) property_index(7)
db 0x00, 0x04 ; item_ID(16)
db 0x05 ; association_count(8)
db 0x82 ; essential(1) property_index(7)
db 0x03 ; essential(1) property_index(7)
db 0x82 ; essential(1) property_index(7)
db 0x04 ; essential(1) property_index(7)
db 0x85 ; essential(1) property_index(7)
db 0x86 ; essential(1) property_index(7)
db 0x00, 0x05 ; item_ID(16)
db 0x05 ; association_count(8)
db 0x82 ; essential(1) property_index(7)
db 0x03 ; essential(1) property_index(7)
db 0x82 ; essential(1) property_index(7)
db 0x04 ; essential(1) property_index(7)
db 0x85 ; essential(1) property_index(7)
db 0x86 ; essential(1) property_index(7)
db 0x00, 0x06 ; item_ID(16)
db 0x05 ; association_count(8)
db 0x82 ; essential(1) property_index(7)
db 0x03 ; essential(1) property_index(7)
db 0x82 ; essential(1) property_index(7)
db 0x04 ; essential(1) property_index(7)
db 0x85 ; essential(1) property_index(7)
db 0x86 ; essential(1) property_index(7)
db 0x00, 0x07 ; item_ID(16)
db 0x05 ; association_count(8)
db 0x82 ; essential(1) property_index(7)
db 0x03 ; essential(1) property_index(7)
db 0x82 ; essential(1) property_index(7)
db 0x04 ; essential(1) property_index(7)
db 0x85 ; essential(1) property_index(7)
db 0x86 ; essential(1) property_index(7)
Expand Down
12 changes: 6 additions & 6 deletions tests/miaf/valid-colours-av1-444.asm
Original file line number Diff line number Diff line change
Expand Up @@ -305,43 +305,43 @@ meta_start:
db 0x86 ; essential(1) property_index(7)
db 0x00, 0x02 ; item_ID(16)
db 0x05 ; association_count(8)
db 0x82 ; essential(1) property_index(7)
db 0x03 ; essential(1) property_index(7)
db 0x82 ; essential(1) property_index(7)
db 0x04 ; essential(1) property_index(7)
db 0x85 ; essential(1) property_index(7)
db 0x86 ; essential(1) property_index(7)
db 0x00, 0x03 ; item_ID(16)
db 0x05 ; association_count(8)
db 0x82 ; essential(1) property_index(7)
db 0x03 ; essential(1) property_index(7)
db 0x82 ; essential(1) property_index(7)
db 0x04 ; essential(1) property_index(7)
db 0x85 ; essential(1) property_index(7)
db 0x86 ; essential(1) property_index(7)
db 0x00, 0x04 ; item_ID(16)
db 0x05 ; association_count(8)
db 0x82 ; essential(1) property_index(7)
db 0x03 ; essential(1) property_index(7)
db 0x82 ; essential(1) property_index(7)
db 0x04 ; essential(1) property_index(7)
db 0x85 ; essential(1) property_index(7)
db 0x86 ; essential(1) property_index(7)
db 0x00, 0x05 ; item_ID(16)
db 0x05 ; association_count(8)
db 0x82 ; essential(1) property_index(7)
db 0x03 ; essential(1) property_index(7)
db 0x82 ; essential(1) property_index(7)
db 0x04 ; essential(1) property_index(7)
db 0x85 ; essential(1) property_index(7)
db 0x86 ; essential(1) property_index(7)
db 0x00, 0x06 ; item_ID(16)
db 0x05 ; association_count(8)
db 0x82 ; essential(1) property_index(7)
db 0x03 ; essential(1) property_index(7)
db 0x82 ; essential(1) property_index(7)
db 0x04 ; essential(1) property_index(7)
db 0x85 ; essential(1) property_index(7)
db 0x86 ; essential(1) property_index(7)
db 0x00, 0x07 ; item_ID(16)
db 0x05 ; association_count(8)
db 0x82 ; essential(1) property_index(7)
db 0x03 ; essential(1) property_index(7)
db 0x82 ; essential(1) property_index(7)
db 0x04 ; essential(1) property_index(7)
db 0x85 ; essential(1) property_index(7)
db 0x86 ; essential(1) property_index(7)
Expand Down

0 comments on commit 2cf3f50

Please sign in to comment.