From: tokyo4j Date: Sat, 30 Aug 2025 05:13:59 +0000 (+0900) Subject: scaled-icon-buffer: fix large client-side icon not being loaded X-Git-Url: https://git.mdlowis.com/?a=commitdiff_plain;h=a382389e5ee0823531a7fd34534b6f364555cab8;p=proto%2Flabwc.git scaled-icon-buffer: fix large client-side icon not being loaded This commit fixes that client-side icons were not loaded when the rendered icon size is larger than icon sizes from the client. This bug has become more likely to happen due to the new thumnail-style window switcher. The cause was `abs(INT_MIN)` becomes `INT_MIN` due to integer overflow. --- diff --git a/src/common/scaled-icon-buffer.c b/src/common/scaled-icon-buffer.c index 49387bac..5dd619f1 100644 --- a/src/common/scaled-icon-buffer.c +++ b/src/common/scaled-icon-buffer.c @@ -22,7 +22,7 @@ static struct lab_data_buffer * choose_best_icon_buffer(struct scaled_icon_buffer *self, int icon_size, double scale) { - int best_dist = INT_MIN; + int best_dist = -INT_MAX; struct lab_data_buffer *best_buffer = NULL; struct lab_data_buffer **buffer;