Skip to content

Commit 8281f2e

Browse files
authored
Replace existing check with AVIF_ASSERT_OR_RETURN (AOMediaCodec#3040)
1 parent 0812f44 commit 8281f2e

1 file changed

Lines changed: 3 additions & 10 deletions

File tree

src/read.c

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2304,16 +2304,9 @@ static avifResult avifDecoderSampleTransformItemValidateProperties(const avifDec
23042304
avifDiagnosticsPrintf(diag, "Item ID %u of type '%.4s' is missing mandatory pixi property", item->id, (const char *)item->type);
23052305
return AVIF_RESULT_BMFF_PARSE_FAILED;
23062306
}
2307-
for (uint8_t i = 0; i < pixiProp->u.pixi.planeCount; ++i) {
2308-
if (pixiProp->u.pixi.planeDepths[i] != pixiProp->u.pixi.planeDepths[0]) {
2309-
avifDiagnosticsPrintf(diag,
2310-
"Item ID %u of type '%.4s' has different depths specified by pixi property [%u, %u], this is not supported",
2311-
item->id,
2312-
(const char *)item->type,
2313-
pixiProp->u.pixi.planeDepths[0],
2314-
pixiProp->u.pixi.planeDepths[i]);
2315-
return AVIF_RESULT_NOT_IMPLEMENTED;
2316-
}
2307+
for (uint8_t i = 1; i < pixiProp->u.pixi.planeCount; ++i) {
2308+
// This is enforced in avifParsePixelInformationProperty().
2309+
AVIF_ASSERT_OR_RETURN(pixiProp->u.pixi.planeDepths[i] == pixiProp->u.pixi.planeDepths[0]);
23172310
}
23182311

23192312
const avifProperty * ispeProp = avifPropertyArrayFind(&item->properties, "ispe");

0 commit comments

Comments
 (0)