From 467baf8a954d249e5578112dc6d7de04485ca5e1 Mon Sep 17 00:00:00 2001 From: Isaac Connor Date: Tue, 20 Apr 2021 11:37:57 -0400 Subject: [PATCH] fix bogus font validation --- src/zm_font.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/zm_font.cpp b/src/zm_font.cpp index 6383ddd9a..92a36501d 100644 --- a/src/zm_font.cpp +++ b/src/zm_font.cpp @@ -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 idx should not be more than filesize */ - if ( (font->header[i].charWidth > 64 && font->header[i].charWidth == 0) || - (font->header[i].charHeight > 200 && font->header[i].charHeight == 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].idx > st.st_size) ) { delete font; font = nullptr;