glcd: fix possible division by zero

Origin commit data
------------------
Commit: 946a613884
Author: Jacek Jendrzej <overx300@gmail.com>
Date: 2020-09-14 (Mon, 14 Sep 2020)
This commit is contained in:
Jacek Jendrzej
2020-09-14 15:18:07 +02:00
parent 08a9549e54
commit 971ee13f1d

View File

@@ -207,6 +207,7 @@ void cGLCD::Exec()
GLCD::cFont font_tmp;
int fw = font_epg.Width(Epg);
fw = (fw == 0) ? 1: fw;
font_tmp.LoadFT2(t.glcd_font, "UTF-8", fontsize_epg * bitmap->Width() / fw);
fw = font_tmp.Width(Epg);
int fh = font_tmp.Height(Epg);