]> git.mdlowis.com Git - proto/labwc.git/commitdiff
scaled-icon-buffer: fix large client-side icon not being loaded
authortokyo4j <hrak1529@gmail.com>
Sat, 30 Aug 2025 05:13:59 +0000 (14:13 +0900)
committerJohan Malm <johanmalm@users.noreply.github.com>
Sat, 30 Aug 2025 07:50:03 +0000 (08:50 +0100)
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

index 49387bace75e65e696178b8a1db4855d9981f2b1..5dd619f14cee52a92e2aaf54e2d6ddb32a0cadf9 100644 (file)
@@ -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;