poppler/Hints.cc |   10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

New commits:
commit 3f5c84e17acfa71dfd44514384398f5a4c449630
Author: Albert Astals Cid <[email protected]>
Date:   Sat Jul 30 17:50:42 2016 +0200

    Check for XRefEntry existing before using it
    
    Bug #97005

diff --git a/poppler/Hints.cc b/poppler/Hints.cc
index bdd0d32..6c2fc25 100644
--- a/poppler/Hints.cc
+++ b/poppler/Hints.cc
@@ -5,7 +5,7 @@
 // This file is licensed under the GPLv2 or later
 //
 // Copyright 2010, 2012 Hib Eris <[email protected]>
-// Copyright 2010, 2011, 2013, 2014 Albert Astals Cid <[email protected]>
+// Copyright 2010, 2011, 2013, 2014, 2016 Albert Astals Cid <[email protected]>
 // Copyright 2010, 2013 Pino Toscano <[email protected]>
 // Copyright 2013 Adrian Johnson <[email protected]>
 // Copyright 2014 Fabio D'Urso <[email protected]>
@@ -43,7 +43,13 @@ Hints::Hints(BaseStream *str, Linearization *linearization, 
XRef *xref, Security
       pageObjectFirst);
     pageObjectFirst = 0;
   }
-  pageOffsetFirst = xref->getEntry(pageObjectFirst)->offset;
+  XRefEntry *pageObjectFirstXRefEntry = xref->getEntry(pageObjectFirst);
+  if (!pageObjectFirstXRefEntry) {
+      error(errSyntaxWarning, -1, "No XRef entry for first page object");
+      pageOffsetFirst = 0;
+  } else {
+      pageOffsetFirst = pageObjectFirstXRefEntry->offset;
+  }
 
   if (nPages >= INT_MAX / (int)sizeof(Guint)) {
      error(errSyntaxWarning, -1, "Invalid number of pages ({0:d}) for hints 
table", nPages);
_______________________________________________
poppler mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/poppler

Reply via email to