[poppler] poppler/Link.cc

Albert Astals Cid aacid at kemper.freedesktop.org
Sun Apr 29 13:00:50 PDT 2012


 poppler/Link.cc |   17 ++++++++++-------
 1 file changed, 10 insertions(+), 7 deletions(-)

New commits:
commit 53b9c2e2806320d0d0e35134b75da5da72514742
Author: Albert Astals Cid <aacid at kde.org>
Date:   Sun Apr 29 22:00:18 2012 +0200

    Just call getNum if isNum is true
    
    Found in a fuzzed pdf sent by Mateusz "j00ru" Jurczyk and Gynvael Coldwind

diff --git a/poppler/Link.cc b/poppler/Link.cc
index 54ef698..b90b1c1 100644
--- a/poppler/Link.cc
+++ b/poppler/Link.cc
@@ -16,7 +16,7 @@
 // Copyright (C) 2006, 2008 Pino Toscano <pino at kde.org>
 // Copyright (C) 2007, 2010, 2011 Carlos Garcia Campos <carlosgc at gnome.org>
 // Copyright (C) 2008 Hugo Mercier <hmercier31 at gmail.com>
-// Copyright (C) 2008-2010 Albert Astals Cid <aacid at kde.org>
+// Copyright (C) 2008-2010, 2012 Albert Astals Cid <aacid at kde.org>
 // Copyright (C) 2009 Kovid Goyal <kovid at kovidgoyal.net>
 // Copyright (C) 2009 Ilya Gorenbein <igorenbein at finjan.com>
 //
@@ -288,23 +288,26 @@ LinkDest::LinkDest(Array *a) {
       kind = destFit;
     }
     obj2.free();
-    if (!a->get(3, &obj2)->isNum()) {
+    if (a->get(3, &obj2)->isNum()) {
+      bottom = obj2.getNum();
+    } else {
       error(errSyntaxWarning, -1, "Bad annotation destination position");
       kind = destFit;
     }
-    bottom = obj2.getNum();
     obj2.free();
-    if (!a->get(4, &obj2)->isNum()) {
+    if (a->get(4, &obj2)->isNum()) {
+      right = obj2.getNum();
+    } else {
       error(errSyntaxWarning, -1, "Bad annotation destination position");
       kind = destFit;
     }
-    right = obj2.getNum();
     obj2.free();
-    if (!a->get(5, &obj2)->isNum()) {
+    if (a->get(5, &obj2)->isNum()) {
+      top = obj2.getNum();
+    } else {
       error(errSyntaxWarning, -1, "Bad annotation destination position");
       kind = destFit;
     }
-    top = obj2.getNum();
     obj2.free();
 
   // FitB link


More information about the poppler mailing list