From a71a66c00bc586e70634e46c79599bab371b6344 Mon Sep 17 00:00:00 2001 From: "mr. m" <91018726+mr-cheffy@users.noreply.github.com> Date: Sat, 2 May 2026 11:36:15 +0200 Subject: [PATCH] no-bug: Force boosts colors to fit in 32 bit ints (gh-13532) --- src/zen/boosts/actors/ZenBoostsChild.sys.mjs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/zen/boosts/actors/ZenBoostsChild.sys.mjs b/src/zen/boosts/actors/ZenBoostsChild.sys.mjs index 2d5aaba28..65c08834d 100644 --- a/src/zen/boosts/actors/ZenBoostsChild.sys.mjs +++ b/src/zen/boosts/actors/ZenBoostsChild.sys.mjs @@ -76,7 +76,7 @@ export class ZenBoostsChild extends JSWindowActorChild { * > #define NS_RGBA(_r, _g, _b, _a) \ * > ((nscolor)(((_a) << 24) | ((_b) << 16) | ((_g) << 8) | (_r))) * - * Converts [r, g, b] array to NSColor + * Converts [r, g, b] array to (uint32_t) NSColor * Make a color out of r,g,b,a values. This assumes that the r,g,b,a * values are properly constrained to 0-255. * @@ -92,7 +92,8 @@ export class ZenBoostsChild extends JSWindowActorChild { // be fully opaque and we need an extra byte to store the contrast value. This allows // us to still use an nscolor as parameter instead of having to deal with WebIDL structs // shenanigans. - return (contrast << 24) | (b << 16) | (g << 8) | r; + // Take into account that its an unsigned int + return ((contrast << 24) | (b << 16) | (g << 8) | r) >>> 0; } /**