[poppler] splash/SplashFTFont.cc

Albert Astals Cid aacid at kemper.freedesktop.org
Wed May 23 17:22:22 UTC 2018


 splash/SplashFTFont.cc |    8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

New commits:
commit 6e2de368f620d2e459a4cfe6533a8c29fae6d8c9
Author: Albert Astals Cid <aacid at kde.org>
Date:   Wed May 23 19:21:30 2018 +0200

    SplashFTFont::SplashFTFont: Early return if textScale is 0
    
    fixes oss-fuzz/8482

diff --git a/splash/SplashFTFont.cc b/splash/SplashFTFont.cc
index de7a494a..61339ef3 100644
--- a/splash/SplashFTFont.cc
+++ b/splash/SplashFTFont.cc
@@ -11,7 +11,7 @@
 // All changes made under the Poppler project to this file are licensed
 // under GPL version 2 or later
 //
-// Copyright (C) 2005, 2007-2011, 2014 Albert Astals Cid <aacid at kde.org>
+// Copyright (C) 2005, 2007-2011, 2014, 2018 Albert Astals Cid <aacid at kde.org>
 // Copyright (C) 2006 Kristian Høgsberg <krh at bitplanet.net>
 // Copyright (C) 2009 Petr Gajdos <pgajdos at novell.com>
 // Copyright (C) 2010 Suzuki Toshiya <mpsuzuki at hiroshima-u.ac.jp>
@@ -42,6 +42,8 @@
 #include "SplashFTFontFile.h"
 #include "SplashFTFont.h"
 
+#include "goo/GooLikely.h"
+
 //------------------------------------------------------------------------
 
 static int glyphPathMoveTo(const FT_Vector *pt, void *path);
@@ -84,6 +86,10 @@ SplashFTFont::SplashFTFont(SplashFTFontFile *fontFileA, SplashCoord *matA,
   // arithmetic doesn't work so well
   textScale = splashDist(0, 0, textMat[2], textMat[3]) / size;
 
+  if (unlikely(textScale == 0)) {
+    return;
+  }
+
   div = face->bbox.xMax > 20000 ? 65536 : 1;
 
 #ifdef USE_FIXEDPOINT


More information about the poppler mailing list