From f6bf186d1ed46f80a461a0982035f7ee8ab689a1 Mon Sep 17 00:00:00 2001 From: ShadelessFox Date: Sun, 17 Jul 2022 17:11:52 +0300 Subject: [PATCH] Fix BC6 block decoder --- src/libImaging/BcnDecode.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/libImaging/BcnDecode.c b/src/libImaging/BcnDecode.c index 22b36eb7acc..c2edd650172 100644 --- a/src/libImaging/BcnDecode.c +++ b/src/libImaging/BcnDecode.c @@ -751,7 +751,9 @@ decode_bc6_block(rgb32f *col, const UINT8 *src, int sign) { } if (info->tr) { /* apply deltas */ for (i = 3; i < numep; i++) { - endpoints[i] = (endpoints[i] + endpoints[0]) & mask; + endpoints[i + 0] = (endpoints[i + 0] + endpoints[0]) & mask; + endpoints[i + 1] = (endpoints[i + 1] + endpoints[1]) & mask; + endpoints[i + 2] = (endpoints[i + 2] + endpoints[2]) & mask; } if (sign) { for (i = 3; i < numep; i += 3) {