diff --git a/CHANGELOG.md b/CHANGELOG.md index 95c1007..115c7a9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -27,6 +27,7 @@ (https://codeberg.org/dnkl/yambar/issues/12). * mpd: fix compilation with clang (https://codeberg.org/dnkl/yambar/issues/16). +* Crash when the alpha component in a color value was 0. ### Security diff --git a/config.c b/config.c index 556891c..743a1a3 100644 --- a/config.c +++ b/config.c @@ -53,6 +53,9 @@ conf_to_color(const struct yml_node *node) uint16_t blue = hex_byte(&hex[4]); uint16_t alpha = hex_byte(&hex[6]); + if (alpha == 0) + return (pixman_color_t){0, 0, 0, 0}; + alpha |= alpha << 8; int alpha_div = 0xffff / alpha;