Skip to content

Commit

Permalink
Print the item type in two diagnostic messages
Browse files Browse the repository at this point in the history
Print the item type in the diagnostic messages for missing mandatory
av1C or pixi property.

Before:
 * [Strict] Item ID 8 is missing mandatory pixi property

After:
 * [Strict] Item ID 8 of type 'grid' is missing mandatory pixi property
  • Loading branch information
wantehchang committed Oct 25, 2021
1 parent 9d8f9f9 commit 455c9d6
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/read.c
Original file line number Diff line number Diff line change
Expand Up @@ -917,14 +917,17 @@ static avifResult avifDecoderItemValidateAV1(const avifDecoderItem * item, avifD
const avifProperty * av1CProp = avifPropertyArrayFind(&item->properties, "av1C");
if (!av1CProp) {
// An av1C box is mandatory in all valid AVIF configurations. Bail out.
avifDiagnosticsPrintf(diag, "Item ID %u is missing mandatory av1C property", item->id);
avifDiagnosticsPrintf(diag, "Item ID %u of type '%.4s' is missing mandatory av1C property", item->id, (const char *)item->type);
return AVIF_RESULT_BMFF_PARSE_FAILED;
}

const avifProperty * pixiProp = avifPropertyArrayFind(&item->properties, "pixi");
if (!pixiProp && (strictFlags & AVIF_STRICT_PIXI_REQUIRED)) {
// A pixi box is mandatory in all valid AVIF configurations. Bail out.
avifDiagnosticsPrintf(diag, "[Strict] Item ID %u is missing mandatory pixi property", item->id);
avifDiagnosticsPrintf(diag,
"[Strict] Item ID %u of type '%.4s' is missing mandatory pixi property",
item->id,
(const char *)item->type);
return AVIF_RESULT_BMFF_PARSE_FAILED;
}

Expand Down

0 comments on commit 455c9d6

Please sign in to comment.