From d1d3f755484d500550d70fc025e3a4a4e6c0a2a8 Mon Sep 17 00:00:00 2001 From: Jean-Marc Lasgouttes Date: Tue, 29 May 2018 15:18:01 +0200 Subject: [PATCH] Fixup dd79338c: avoid hypothetical division by zero Spotted by Coverity. --- src/frontends/qt4/GuiView.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/frontends/qt4/GuiView.cpp b/src/frontends/qt4/GuiView.cpp index 47a56882b1..435738957c 100644 --- a/src/frontends/qt4/GuiView.cpp +++ b/src/frontends/qt4/GuiView.cpp @@ -220,7 +220,7 @@ public: } // The longest line in the reference font (for English) // is 180. Calculate scale factor from that. - double const wscale = (180.0 / wline); + double const wscale = wline > 0 ? (180.0 / wline) : 1; // Now do the same for the height (necessary for condensed fonts) double const hscale = (34.0 / hline); // take the lower of the two scale factors.