utils/pdfimages.cc |    7 +++++++
 1 file changed, 7 insertions(+)

New commits:
commit 72f5509211438a7e5e1f1e2290fb6cbda2b923c9
Author: Hartmut Goebel <[email protected]>
Date:   Tue Dec 24 13:46:25 2019 +0000

    pdfimages: Add error message if first page is larger then number of pages.

diff --git a/utils/pdfimages.cc b/utils/pdfimages.cc
index 5e5fde78..6ae92b34 100644
--- a/utils/pdfimages.cc
+++ b/utils/pdfimages.cc
@@ -22,6 +22,7 @@
 // Copyright (C) 2013 Suzuki Toshiya <[email protected]>
 // Copyright (C) 2018 Adam Reichold <[email protected]>
 // Copyright (C) 2019 Oliver Sander <[email protected]>
+// Copyright (C) 2019 Hartmut Goebel <[email protected]>
 //
 // To see a description of the changes please see the Changelog file that
 // came with your tarball or type make ChangeLog if you are building from git
@@ -191,6 +192,12 @@ int main(int argc, char *argv[]) {
   // get page range
   if (firstPage < 1)
     firstPage = 1;
+  if (firstPage > doc->getNumPages()) {
+    error(errCommandLine, -1,
+          "Wrong page range given: the first page ({0:d}) can not be larger 
then the number of pages in the document ({1:d}).",
+          firstPage, doc->getNumPages());
+    goto err1;
+  }
   if (lastPage < 1 || lastPage > doc->getNumPages())
     lastPage = doc->getNumPages();
   if (lastPage < firstPage) {
_______________________________________________
poppler mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/poppler

Reply via email to