From b084bb9d40876bdd2f2fbfc5c989177684555291 Mon Sep 17 00:00:00 2001 From: Dimitar Tsenev Date: Tue, 15 Oct 2024 22:15:46 +0300 Subject: [PATCH] [Fixed] Wrong handling of 8bit images (cherry picked from commit 6675294aa4545249262f8a434ad5c39112759b71) --- lib/gdi/picload.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/gdi/picload.cpp b/lib/gdi/picload.cpp index 6097b72bfec..80aeb9bc560 100644 --- a/lib/gdi/picload.cpp +++ b/lib/gdi/picload.cpp @@ -412,7 +412,7 @@ static void png_load(Cfilepara *filepara, unsigned int background) filepara->transparent = (trans_alpha != NULL); } - if ((bit_depth <= 8) && (color_type == PNG_COLOR_TYPE_GRAY || color_type & PNG_COLOR_MASK_PALETTE)) + if ((bit_depth <= 8) && (color_type == PNG_COLOR_TYPE_GRAY || color_type & PNG_COLOR_MASK_PALETTE || color_type == PNG_COLOR_TYPE_RGBA)) { if (bit_depth < 8) png_set_packing(png_ptr);