From cd21272b34268f767972d8c297480c0b2653db4c 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..9e830cf072c 100644 --- a/src/libImaging/BcnDecode.c +++ b/src/libImaging/BcnDecode.c @@ -750,8 +750,10 @@ decode_bc6_block(rgb32f *col, const UINT8 *src, int sign) { } } if (info->tr) { /* apply deltas */ - for (i = 3; i < numep; i++) { + for (i = 3; i < numep; i += 3) { endpoints[i] = (endpoints[i] + 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) {