[poppler] poppler/Gfx.cc

Albert Astals Cid aacid at kemper.freedesktop.org
Mon Jul 2 18:11:01 UTC 2018


 poppler/Gfx.cc |    6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

New commits:
commit d8346166d5150c1673379dcb3c658b9805f99764
Author: Albert Astals Cid <aacid at kde.org>
Date:   Mon Jul 2 20:10:25 2018 +0200

    Gfx::doRadialShFill: Don't divide by zero
    
    fixes oss-fuzz/9133

diff --git a/poppler/Gfx.cc b/poppler/Gfx.cc
index 0763e49f..8f2c62d2 100644
--- a/poppler/Gfx.cc
+++ b/poppler/Gfx.cc
@@ -3048,7 +3048,11 @@ void Gfx::doRadialShFill(GfxRadialShading *shading) {
   if (t < 1) {
     n = 3;
   } else {
-    n = (int)(M_PI / acos(1 - 0.1 / t));
+    const double tmp = 1 - 0.1 / t;
+    if (unlikely(tmp == 1))
+      n = 200;
+    else
+      n = (int)(M_PI / acos(tmp));
     if (n < 3) {
       n = 3;
     } else if (n > 200) {


More information about the poppler mailing list