qt4/tests/test-poppler-qt4.cpp |    6 ++++++
 1 file changed, 6 insertions(+)

New commits:
commit bb7996eaaad6a70404891bb2ff530160737ea3d7
Author: Albert Astals Cid <[EMAIL PROTECTED]>
Date:   Mon Sep 1 20:29:25 2008 +0200

    Do not crash on documents with no pages

diff --git a/qt4/tests/test-poppler-qt4.cpp b/qt4/tests/test-poppler-qt4.cpp
index 0f868b4..9b92d05 100644
--- a/qt4/tests/test-poppler-qt4.cpp
+++ b/qt4/tests/test-poppler-qt4.cpp
@@ -193,6 +193,12 @@ int main( int argc, char **argv )
         qDebug() << "No embedded files";
     }
 
+    if (doc->numPages() <= 0)
+    {
+        delete doc;
+        qDebug() << "Doc has no pages";
+        return 0;
+    }
 
     Poppler::Page *page = doc->page(0);
     qDebug() << "Page 1 size: " << page->pageSize().width()/72 << "inches x " 
<< page->pageSize().height()/72 << "inches";
_______________________________________________
poppler mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/poppler

Reply via email to