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;