From de8ef0687c53ad0f900c70f82fe8aad21de83f83 Mon Sep 17 00:00:00 2001 From: Jacek Jendrzej Date: Mon, 14 Sep 2020 15:18:07 +0200 Subject: [PATCH] glcd: fix possible division by zero Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/946a61388483fa7ccbcea27db986583d2bf14295 Author: Jacek Jendrzej Date: 2020-09-14 (Mon, 14 Sep 2020) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/driver/glcd/glcd.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/driver/glcd/glcd.cpp b/src/driver/glcd/glcd.cpp index abf1816b2..59109c2f4 100644 --- a/src/driver/glcd/glcd.cpp +++ b/src/driver/glcd/glcd.cpp @@ -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);