From e392eba42b764c15479917f6722efbfda87b41d8 Mon Sep 17 00:00:00 2001 From: tokyo4j Date: Sat, 30 Aug 2025 14:13:59 +0900 Subject: [PATCH] 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. --- src/common/scaled-icon-buffer.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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;