Skip to content

Commit

Permalink
Add explicit casts for depth
Browse files Browse the repository at this point in the history
  • Loading branch information
y-guyon committed Aug 7, 2024
1 parent a6a2752 commit 0f8e1f5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/read.c
Original file line number Diff line number Diff line change
Expand Up @@ -3888,7 +3888,7 @@ static avifResult avifParseMinimizedImageBox(avifMeta * meta, uint64_t rawOffset
AVIF_CHECKERR(pixiProp, AVIF_RESULT_OUT_OF_MEMORY);
pixiProp->u.pixi.planeCount = chromaSubsampling == 0 ? 1 : 3;
for (uint8_t plane = 0; plane < pixiProp->u.pixi.planeCount; ++plane) {
pixiProp->u.pixi.planeDepths[plane] = bitDepth;
pixiProp->u.pixi.planeDepths[plane] = (uint8_t)bitDepth;
}
AVIF_CHECKERR(avifDecoderItemAddProperty(colorItem, pixiProp), AVIF_RESULT_OUT_OF_MEMORY);

Expand Down Expand Up @@ -3943,7 +3943,7 @@ static avifResult avifParseMinimizedImageBox(avifMeta * meta, uint64_t rawOffset
AVIF_CHECKERR(alphaPixiProp, AVIF_RESULT_OUT_OF_MEMORY);
memcpy(alphaPixiProp->type, "pixi", 4);
alphaPixiProp->u.pixi.planeCount = 1;
alphaPixiProp->u.pixi.planeDepths[0] = bitDepth;
alphaPixiProp->u.pixi.planeDepths[0] = (uint8_t)bitDepth;
AVIF_CHECKERR(avifDecoderItemAddProperty(alphaItem, alphaPixiProp), AVIF_RESULT_OUT_OF_MEMORY);
} else {
// Placeholders 6, 7 and 8.
Expand Down

0 comments on commit 0f8e1f5

Please sign in to comment.