Blob Blame Raw
From 88dbd4df0998233939b4a51cedbfc65c58a315f9 Mon Sep 17 00:00:00 2001
From: Adrian Johnson <ajohnson@redneon.com>
Date: Sun, 19 Oct 2014 22:47:15 +1030
Subject: [PATCH] pdfdetach: fix crash when getPage() returns null

Bug 85145
---
 utils/pdfdetach.cc | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/utils/pdfdetach.cc b/utils/pdfdetach.cc
index 4f67fd7..3bae3c0 100644
--- a/utils/pdfdetach.cc
+++ b/utils/pdfdetach.cc
@@ -163,6 +163,8 @@ int main(int argc, char *argv[]) {
   nPages = doc->getCatalog()->getNumPages();
   for (i = 0; i < nPages; ++i) {
     page = doc->getCatalog()->getPage(i + 1);
+    if (!page)
+      continue;
     annots = page->getAnnots();
     if (!annots)
       break;
-- 
2.1.0