1
0
Fork 0
mirror of https://github.com/polybar/polybar.git synced 2024-11-11 13:50:56 -05:00

fix(fontmanager): Add safety check

This commit is contained in:
Michael Carlberg 2016-10-29 21:06:38 +02:00
parent 7a790aa87d
commit c3969e85ef

View file

@ -220,6 +220,8 @@ class fontmanager {
} else {
if (chr < font->char_min || chr > font->char_max)
return false;
if (static_cast<size_t>(chr - font->char_min) >= font->width_lut.size())
return false;
if (font->width_lut[chr - font->char_min].character_width == 0)
return false;
return true;