fix bogus font validation

pull/3222/head
Isaac Connor 2021-04-20 11:37:57 -04:00
parent 9970df7fde
commit 467baf8a95
1 changed files with 2 additions and 2 deletions

View File

@ -35,8 +35,8 @@ int ZmFont::ReadFontFile(const std::string &loc) {
height cannot be greater than 200(arbitary number which i have chosen, shouldn't need more than this) and height cannot be greater than 200(arbitary number which i have chosen, shouldn't need more than this) and
idx should not be more than filesize idx should not be more than filesize
*/ */
if ( (font->header[i].charWidth > 64 && font->header[i].charWidth == 0) || if ( font->header[i].charWidth > 64 || font->header[i].charWidth == 0 ||
(font->header[i].charHeight > 200 && font->header[i].charHeight == 0) || font->header[i].charHeight > 200 || font->header[i].charHeight == 0 ||
(font->header[i].idx > st.st_size) ) { (font->header[i].idx > st.st_size) ) {
delete font; delete font;
font = nullptr; font = nullptr;