[poppler] poppler/Gfx.cc

Albert Astals Cid aacid at kemper.freedesktop.org
Tue May 22 20:12:45 UTC 2018


 poppler/Gfx.cc |    7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

New commits:
commit a6c2eb671f08beb682e086d5f6791fdb78906a7c
Author: Albert Astals Cid <aacid at kde.org>
Date:   Tue May 22 22:12:03 2018 +0200

    Make sure dash[i] is intialized
    
    even if obj is not a number
    
    fixes oss-fuzz/8462

diff --git a/poppler/Gfx.cc b/poppler/Gfx.cc
index e0ccb4c2..01ededcd 100644
--- a/poppler/Gfx.cc
+++ b/poppler/Gfx.cc
@@ -947,11 +947,10 @@ void Gfx::opSetDash(Object args[], int numArgs) {
     dash = nullptr;
   } else {
     dash = (double *)gmallocn(length, sizeof(double));
+    bool dummyOk;
     for (i = 0; i < length; ++i) {
-      Object obj = a->get(i);
-      if (obj.isNum()) {
-	dash[i] = obj.getNum();
-      }
+      const Object obj = a->get(i);
+      dash[i] = obj.getNum(&dummyOk);
     }
   }
   state->setLineDash(dash, length, args[1].getNum());


More information about the poppler mailing list