From 49729a67a2baf569b2e39ba507e9bc2fa6d1566c Mon Sep 17 00:00:00 2001 From: UnknownShadow200 Date: Sat, 4 Sep 2021 09:31:12 +1000 Subject: [PATCH] Fix PNGs that are encoded using indexed mode and have a transparent chunk not decoding properly on big endian systems (Thanks Doctorj1) --- src/Bitmap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Bitmap.c b/src/Bitmap.c index 606c4e725..7b9b6d152 100644 --- a/src/Bitmap.c +++ b/src/Bitmap.c @@ -442,7 +442,7 @@ cc_result Png_Decode(struct Bitmap* bmp, struct Stream* stream) { /* set alpha component of palette */ for (i = 0; i < dataSize; i++) { palette[i] &= BITMAPCOL_RGB_MASK; /* set A to 0 */ - palette[i] |= tmp[i] << PACKEDCOL_A_SHIFT; + palette[i] |= tmp[i] << BITMAPCOL_A_SHIFT; } } else if (col == PNG_COL_RGB) { if (dataSize != 6) return PNG_ERR_TRANS_COUNT;