From 0477278c68f93f2e0c9f37c0badde62bfe0301aa Mon Sep 17 00:00:00 2001 From: Istvan Fehervari Date: Thu, 3 Aug 2017 11:07:51 +0200 Subject: [PATCH] Fixed bc5 decoding BC5 decoding uses only 2 channels instead of 4. The current algorithm did not initialize the RGBA struct which resulted in random values in the output image. This commit should initialize the decoded RGBA struct, thus setting B and A values to default (0). --- libImaging/BcnDecode.c | 1 + 1 file changed, 1 insertion(+) diff --git a/libImaging/BcnDecode.c b/libImaging/BcnDecode.c index b24a3ebb5..58d3ecc10 100644 --- a/libImaging/BcnDecode.c +++ b/libImaging/BcnDecode.c @@ -815,6 +815,7 @@ static int decode_bcn(Imaging im, ImagingCodecState state, const UINT8* src, int case NN: \ while (bytes >= SZ) { \ TY col[16]; \ + memset(col, 0, 16 * sizeof(col[0])); \ decode_bc##NN##_block(col, ptr); \ put_block(im, state, (const char *)col, sizeof(col[0]), C); \ ptr += SZ; \