From 097f7d0f56baecf35a63e29960666def35fb5925 Mon Sep 17 00:00:00 2001 From: Jan Solanti Date: Wed, 16 Oct 2019 00:21:15 +0300 Subject: [PATCH] Stop decoding BC1 punchthrough alpha in BC2&3 --- src/libImaging/BcnDecode.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/libImaging/BcnDecode.c b/src/libImaging/BcnDecode.c index b6a4cbadc..611daba57 100644 --- a/src/libImaging/BcnDecode.c +++ b/src/libImaging/BcnDecode.c @@ -69,7 +69,7 @@ decode_565(UINT16 x) { } static void -decode_bc1_color(rgba *dst, const UINT8 *src) { +decode_bc1_color(rgba *dst, const UINT8 *src, int separate_alpha) { bc1_color col; rgba p[4]; int n, cw; @@ -150,13 +150,13 @@ decode_bc3_alpha(char *dst, const UINT8 *src, int stride, int o) { static void decode_bc1_block(rgba *col, const UINT8 *src) { - decode_bc1_color(col, src); + decode_bc1_color(col, src, 0); } static void decode_bc2_block(rgba *col, const UINT8 *src) { int n, bitI, byI, av; - decode_bc1_color(col, src + 8); + decode_bc1_color(col, src + 8, 1); for (n = 0; n < 16; n++) { bitI = n * 4; byI = bitI >> 3; @@ -168,7 +168,7 @@ decode_bc2_block(rgba *col, const UINT8 *src) { static void decode_bc3_block(rgba *col, const UINT8 *src) { - decode_bc1_color(col, src + 8); + decode_bc1_color(col, src + 8, 1); decode_bc3_alpha((char *)col, src, sizeof(col[0]), 3); }