Skip to content

Commit 5572e9c

Browse files
committed
read: Fix some return values
`AVIF_FALSE` is being returned from some functions which return `avifResult`. `AVIF_FALSE` is `0` which translates to `AVIF_RESULT_OK` when (accidentally) converted to `avifResult` which is incorrect. I think this was a copy-paste error from functions which were previously returning `avifBool`.
1 parent 98cd381 commit 5572e9c

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/read.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3390,7 +3390,7 @@ static avifResult avifParseMetaBox(avifMeta * meta, uint64_t rawOffset, const ui
33903390
// The handler type for the MetaBox shall be 'pict'.
33913391
if (memcmp(handlerType, "pict", 4) != 0) {
33923392
avifDiagnosticsPrintf(diag, "Box[hdlr] handler_type is not 'pict'");
3393-
return AVIF_FALSE;
3393+
return AVIF_RESULT_BMFF_PARSE_FAILED;
33943394
}
33953395
firstBox = AVIF_FALSE;
33963396
} else {
@@ -3958,15 +3958,15 @@ static avifResult avifParseMovieBox(avifDecoderData * data,
39583958
!memcmp(track->handlerType, "auxv", 4)) {
39593959
if ((track->width == 0) || (track->height == 0)) {
39603960
avifDiagnosticsPrintf(data->diag, "Track ID [%u] has an invalid size [%ux%u]", track->id, track->width, track->height);
3961-
return AVIF_FALSE;
3961+
return AVIF_RESULT_BMFF_PARSE_FAILED;
39623962
}
39633963
if (avifDimensionsTooLarge(track->width, track->height, imageSizeLimit, imageDimensionLimit)) {
39643964
avifDiagnosticsPrintf(data->diag,
39653965
"Track ID [%u] dimensions are too large [%ux%u]",
39663966
track->id,
39673967
track->width,
39683968
track->height);
3969-
return AVIF_FALSE;
3969+
return AVIF_RESULT_BMFF_PARSE_FAILED;
39703970
}
39713971
}
39723972
}

0 commit comments

Comments
 (0)