glcd: fix possible division by zero

Origin commit data
------------------
Branch: ni/coolstream
Commit: 946a613884
Author: Jacek Jendrzej <overx300@gmail.com>
Date: 2020-09-14 (Mon, 14 Sep 2020)


------------------
No further description and justification available within origin commit message!

------------------
This commit was generated by Migit
This commit is contained in:
Jacek Jendrzej
2020-09-14 15:18:07 +02:00
parent a8141628de
commit de8ef0687c

View File

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