Skip to content

Commit

Permalink
Assert the presence of the alpha plane (if necessary) in avifImageYUV…
Browse files Browse the repository at this point in the history
…AnyToRGBAnySlow()
  • Loading branch information
Joe Drago authored and joedrago committed Jul 14, 2021
1 parent ea3e97e commit 772b49e
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/reformat.c
Original file line number Diff line number Diff line change
Expand Up @@ -442,6 +442,11 @@ static avifResult avifImageYUVAnyToRGBAnySlow(const avifImage * image,
// These are the only supported built-ins
assert((chromaUpsampling == AVIF_CHROMA_UPSAMPLING_BILINEAR) || (chromaUpsampling == AVIF_CHROMA_UPSAMPLING_NEAREST));

// If toRGBAlphaMode is active (not no-op), assert that the alpha plane is present. The end of
// the avifPrepareReformatState() function should ensure this, but this assert makes it clear
// to clang's analyzer.
assert((state->toRGBAlphaMode == AVIF_ALPHA_MULTIPLY_MODE_NO_OP) || aPlane);

for (uint32_t j = 0; j < image->height; ++j) {
const uint32_t uvJ = j >> state->formatInfo.chromaShiftY;
const uint8_t * ptrY8 = &yPlane[j * yRowBytes];
Expand Down

0 comments on commit 772b49e

Please sign in to comment.