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.
This commit is contained in:
tokyo4j 2025-08-30 14:13:59 +09:00 committed by Johan Malm
parent 2e9292b7a3
commit a382389e5e

View 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;