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:
parent
7a790aa87d
commit
c3969e85ef
1 changed files with 2 additions and 0 deletions
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue