From 78b0e06dbbe8f7cdeee1fd9234c13b6d4d997876 Mon Sep 17 00:00:00 2001 From: Andrew Murray Date: Tue, 14 Oct 2025 23:41:50 +1100 Subject: [PATCH] Shift bits before making value negative --- src/libImaging/BcnDecode.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libImaging/BcnDecode.c b/src/libImaging/BcnDecode.c index 7b3d8f908..ac81ed6df 100644 --- a/src/libImaging/BcnDecode.c +++ b/src/libImaging/BcnDecode.c @@ -603,7 +603,7 @@ static void bc6_sign_extend(UINT16 *v, int prec) { int x = *v; if (x & (1 << (prec - 1))) { - x |= -1 << prec; + x |= -(1 << prec); } *v = (UINT16)x; }