summaryrefslogtreecommitdiff
path: root/utils/pdfinfo.cc
diff options
context:
space:
mode:
Diffstat (limited to 'utils/pdfinfo.cc')
-rw-r--r--utils/pdfinfo.cc7
1 files changed, 7 insertions, 0 deletions
diff --git a/utils/pdfinfo.cc b/utils/pdfinfo.cc
index 22d9edd9..5a9745fa 100644
--- a/utils/pdfinfo.cc
+++ b/utils/pdfinfo.cc
@@ -20,6 +20,7 @@
// Copyright (C) 2012, 2013 Adrian Johnson <ajohnson@redneon.com>
// Copyright (C) 2012 Fabio D'Urso <fabiodurso@hotmail.it>
// Copyright (C) 2013 Adrian Perez de Castro <aperez@igalia.com>
+// Copyright (C) 2013 Suzuki Toshiya <mpsuzuki@hiroshima-u.ac.jp>
//
// 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
@@ -207,6 +208,12 @@ int main(int argc, char *argv[]) {
if (lastPage < 1 || lastPage > doc->getNumPages()) {
lastPage = doc->getNumPages();
}
+ if (lastPage < firstPage) {
+ error(errCommandLine, -1,
+ "Wrong page range given: the first page ({0:d}) can not be after the last page ({1:d}).",
+ firstPage, lastPage);
+ goto err2;
+ }
// print doc info
doc->getDocInfo(&info);