[poppler] 5 commits - CMakeLists.txt configure.ac cpp/Doxyfile NEWS poppler/JBIG2Stream.cc poppler/Makefile.am qt4/src qt5/src utils/pdffonts.cc utils/pdfimages.cc utils/pdfinfo.cc utils/pdfseparate.cc utils/pdftocairo.cc utils/pdftohtml.cc utils/pdftoppm.cc utils/pdftops.cc utils/pdftotext.cc

Albert Astals Cid aacid at kemper.freedesktop.org
Sat Dec 7 08:56:15 PST 2013


 CMakeLists.txt         |    4 ++--
 NEWS                   |   18 ++++++++++++++++++
 configure.ac           |    2 +-
 cpp/Doxyfile           |    2 +-
 poppler/JBIG2Stream.cc |    2 +-
 poppler/Makefile.am    |    2 +-
 qt4/src/Doxyfile       |    2 +-
 qt5/src/Doxyfile       |    2 +-
 utils/pdffonts.cc      |    7 +++++++
 utils/pdfimages.cc     |    7 +++++++
 utils/pdfinfo.cc       |    7 +++++++
 utils/pdfseparate.cc   |    7 +++++++
 utils/pdftocairo.cc    |    7 +++++++
 utils/pdftohtml.cc     |    6 ++++++
 utils/pdftoppm.cc      |    7 +++++++
 utils/pdftops.cc       |    7 +++++++
 utils/pdftotext.cc     |    7 +++++++
 17 files changed, 88 insertions(+), 8 deletions(-)

New commits:
commit f77bc21813ae7234ec4ce94ce4e92230fe5c174a
Merge: 06e9dc9 58e04a0
Author: Albert Astals Cid <aacid at kde.org>
Date:   Sat Dec 7 16:56:11 2013 +0000

    Merge remote-tracking branch 'origin/poppler-0.24'
    
    Conflicts:
    	utils/pdfimages.cc
    	utils/pdfinfo.cc
    	utils/pdfseparate.cc

diff --cc utils/pdfimages.cc
index 96709ed,e898985..563839e
--- a/utils/pdfimages.cc
+++ b/utils/pdfimages.cc
@@@ -18,7 -18,8 +18,8 @@@
  // Copyright (C) 2007-2008, 2010 Albert Astals Cid <aacid at kde.org>
  // Copyright (C) 2010 Hib Eris <hib at hiberis.nl>
  // Copyright (C) 2010 Jakob Voss <jakob.voss at gbv.de>
 -// Copyright (C) 2012 Adrian Johnson <ajohnson at redneon.com>
 +// Copyright (C) 2012, 2013 Adrian Johnson <ajohnson at redneon.com>
+ // Copyright (C) 2013 Suzuki Toshiya <mpsuzuki at 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
@@@ -188,27 -167,18 +189,33 @@@ int main(int argc, char *argv[]) 
      firstPage = 1;
    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 err1;
+   }
  
    // write image files
 -  imgOut = new ImageOutputDev(imgRoot, pageNames, dumpJPEG, listImages);
 +  imgOut = new ImageOutputDev(imgRoot, pageNames, listImages);
    if (imgOut->isOk()) {
 -      doc->displayPages(imgOut, firstPage, lastPage, 72, 72, 0,
 -			gTrue, gFalse, gFalse);
 +    if (allFormats) {
 +      imgOut->enablePNG(gTrue);
 +      imgOut->enableTiff(gTrue);
 +      imgOut->enableJpeg(gTrue);
 +      imgOut->enableJpeg2000(gTrue);
 +      imgOut->enableJBig2(gTrue);
 +      imgOut->enableCCITT(gTrue);
 +    } else {
 +      imgOut->enablePNG(enablePNG);
 +      imgOut->enableTiff(enableTiff);
 +      imgOut->enableJpeg(dumpJPEG);
 +      imgOut->enableJpeg2000(dumpJP2);
 +      imgOut->enableJBig2(dumpJBIG2);
 +      imgOut->enableCCITT(dumpCCITT);
 +    }
 +    doc->displayPages(imgOut, firstPage, lastPage, 72, 72, 0,
 +                      gTrue, gFalse, gFalse);
    }
    delete imgOut;
  
diff --cc utils/pdfinfo.cc
index 22d9edd,68fbd20..5a9745f
--- a/utils/pdfinfo.cc
+++ b/utils/pdfinfo.cc
@@@ -19,7 -19,7 +19,8 @@@
  // Copyright (C) 2011 Vittal Aithal <vittal.aithal at cognidox.com>
  // Copyright (C) 2012, 2013 Adrian Johnson <ajohnson at redneon.com>
  // Copyright (C) 2012 Fabio D'Urso <fabiodurso at hotmail.it>
 +// Copyright (C) 2013 Adrian Perez de Castro <aperez at igalia.com>
+ // Copyright (C) 2013 Suzuki Toshiya <mpsuzuki at 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
diff --cc utils/pdfseparate.cc
index dcb59f6,d93ca3e..78dbf12
--- a/utils/pdfseparate.cc
+++ b/utils/pdfseparate.cc
@@@ -7,7 -7,7 +7,8 @@@
  // Copyright (C) 2011, 2012 Thomas Freitag <Thomas.Freitag at alfa.de>
  // Copyright (C) 2012, 2013 Albert Astals Cid <aacid at kde.org>
  // Copyright (C) 2013 Pino Toscano <pino at kde.org>
 +// Copyright (C) 2013 Daniel Kahn Gillmor <dkg at fifthhorseman.net>
+ // Copyright (C) 2013 Suzuki Toshiya <mpsuzuki at hiroshima-u.ac.jp>
  //
  //========================================================================
  #include "config.h"
@@@ -70,31 -64,25 +71,37 @@@ bool extractPages (const char *srcFileN
      lastPage = doc->getNumPages();
    if (firstPage == 0)
      firstPage = 1;
+   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);
+     return false;
+   }
 -  if (firstPage != lastPage && strstr(destFileName, "%d") == NULL) {
 -    error(errSyntaxError, -1, "'{0:s}' must contain '%d' if more than one page should be extracted", destFileName);
 +  bool foundmatch = false;
 +  char *p = strstr(auxDestFileName, "%d");
 +  if (p != NULL) {
 +    foundmatch = true;
 +    *p = 'A';
 +  } else {
 +    char pattern[5];
 +    for (int i = 2; i < 10; i++) {
 +      sprintf(pattern, "%%0%dd", i);
 +      p = strstr(auxDestFileName, pattern);
 +      if (p != NULL) {
 +       foundmatch = true;
 +       *p = 'A';
 +       break;
 +      }
 +    }
 +  }
 +  if (!foundmatch && firstPage != lastPage) {
 +    error(errSyntaxError, -1, "'{0:s}' must contain '%%d' if more than one page should be extracted", destFileName);
 +    free(auxDestFileName);
      return false;
    }
 -  
 -  // destFileName can have multiple %% and one %d
 -  // We use auxDestFileName to replace all the valid % appearances
 -  // by 'A' (random char that is not %), if at the end of replacing
 -  // any of the valid appearances there is still any % around, the
 -  // pattern is wrong
 -  char *auxDestFileName = strdup(destFileName);
 -  // %% can appear as many times as you want
 -  char *p = strstr(auxDestFileName, "%%");
 +
 +  // at this point auxDestFileName can only contain %%
 +  p = strstr(auxDestFileName, "%%");
    while (p != NULL) {
      *p = 'A';
      *(p + 1) = 'A';
commit 58e04a08afee39370283c494ee2e4e392fd3b684
Author: Fabio D'Urso <fabiodurso at hotmail.it>
Date:   Sat Dec 7 16:33:09 2013 +0000

    segExtraBytes is a goffset not an int so use lld
    
    Fixes KDE bug #328511

diff --git a/poppler/JBIG2Stream.cc b/poppler/JBIG2Stream.cc
index 12de50e..dbc7bdc 100644
--- a/poppler/JBIG2Stream.cc
+++ b/poppler/JBIG2Stream.cc
@@ -1495,7 +1495,7 @@ void JBIG2Stream::readSegments() {
 	// arithmetic-coded symbol dictionary segments when numNewSyms
 	// == 0.  Segments like this often occur for blank pages.
 	
-	error(errSyntaxError, curStr->getPos(), "{0:d} extraneous byte{1:s} after segment",
+	error(errSyntaxError, curStr->getPos(), "{0:lld} extraneous byte{1:s} after segment",
 	      segExtraBytes, (segExtraBytes > 1) ? "s" : "");
 	
 	// Burn through the remaining bytes -- inefficient, but
commit 0af3e009a702d0c6ca716565ab87b386baa0a1ed
Author: Albert Astals Cid <aacid at kde.org>
Date:   Wed Nov 27 00:53:16 2013 +0100

    0.24.4

diff --git a/CMakeLists.txt b/CMakeLists.txt
index d8ee924..9b66a69 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -18,7 +18,7 @@ CHECK_FILE_OFFSET_BITS()
 
 set(POPPLER_MAJOR_VERSION "0")
 set(POPPLER_MINOR_VERSION "24")
-set(POPPLER_MICRO_VERSION "3")
+set(POPPLER_MICRO_VERSION "4")
 set(POPPLER_VERSION "${POPPLER_MAJOR_VERSION}.${POPPLER_MINOR_VERSION}.${POPPLER_MICRO_VERSION}")
 
 # command line switches
@@ -423,7 +423,7 @@ add_library(poppler STATIC ${poppler_SRCS})
 else(MSVC)
 add_library(poppler SHARED ${poppler_SRCS})
 endif(MSVC)
-set_target_properties(poppler PROPERTIES VERSION 43.0.0 SOVERSION 43)
+set_target_properties(poppler PROPERTIES VERSION 44.0.0 SOVERSION 44)
 target_link_libraries(poppler ${poppler_LIBS})
 target_link_libraries(poppler LINK_INTERFACE_LIBRARIES "")
 install(TARGETS poppler RUNTIME DESTINATION bin LIBRARY DESTINATION lib${LIB_SUFFIX} ARCHIVE DESTINATION lib${LIB_SUFFIX})
diff --git a/NEWS b/NEWS
index 03a9e68..ff38e7f 100644
--- a/NEWS
+++ b/NEWS
@@ -1,3 +1,21 @@
+Release 0.24.4
+        core:
+         * Fix regression in broken endstream detection. Bug #70854
+         * Catalog: sort entries of NameTrees to make sure lookup works. Bug #26049
+         * Don't infinite loop if reading from GooFile::read fails. Bug #71835
+
+        utils:
+         * pdftotext: Do not close stdout. Bug #71639
+         * pdftotext: Silence warning for may be used uninitialized variable. Bug #71640
+         * pdftotext: Escape the text of the xml headers
+         * Warn the user if he provides a wrong range
+
+        qt4:
+         * Fix typo in xml API. Bug #71643
+
+        qt5:
+         * Fix typo in xml API. Bug #71643
+
 Release 0.24.3
         core:
          * PSOutputDev: Fix PFB font embedding. Bug #69717
diff --git a/configure.ac b/configure.ac
index 88112cb..2f44f71 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1,6 +1,6 @@
 m4_define([poppler_version_major],[0])
 m4_define([poppler_version_minor],[24])
-m4_define([poppler_version_micro],[3])
+m4_define([poppler_version_micro],[4])
 m4_define([poppler_version],[poppler_version_major.poppler_version_minor.poppler_version_micro])
 
 AC_PREREQ(2.59)
diff --git a/cpp/Doxyfile b/cpp/Doxyfile
index 2c67532..d84579d 100644
--- a/cpp/Doxyfile
+++ b/cpp/Doxyfile
@@ -31,7 +31,7 @@ PROJECT_NAME           = "Poppler CPP"
 # This could be handy for archiving the generated documentation or
 # if some version control system is used.
 
-PROJECT_NUMBER         = 0.24.3
+PROJECT_NUMBER         = 0.24.4
 
 # The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute)
 # base path where the generated documentation will be put.
diff --git a/poppler/Makefile.am b/poppler/Makefile.am
index aa7c924..6e21c17 100644
--- a/poppler/Makefile.am
+++ b/poppler/Makefile.am
@@ -157,7 +157,7 @@ libpoppler_la_LIBADD =				\
 	$(PTHREAD_LIBS)				\
 	$(win32_libs)
 
-libpoppler_la_LDFLAGS = -version-info 43:0:0 @create_shared_lib@ @auto_import_flags@
+libpoppler_la_LDFLAGS = -version-info 44:0:0 @create_shared_lib@ @auto_import_flags@
 
 if ENABLE_XPDF_HEADERS
 
diff --git a/qt4/src/Doxyfile b/qt4/src/Doxyfile
index 7cb051a..70665af 100644
--- a/qt4/src/Doxyfile
+++ b/qt4/src/Doxyfile
@@ -31,7 +31,7 @@ PROJECT_NAME           = "Poppler Qt4 "
 # This could be handy for archiving the generated documentation or
 # if some version control system is used.
 
-PROJECT_NUMBER         = 0.24.3
+PROJECT_NUMBER         = 0.24.4
 
 # The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute)
 # base path where the generated documentation will be put.
diff --git a/qt5/src/Doxyfile b/qt5/src/Doxyfile
index 8678bc2..4f70d4c 100644
--- a/qt5/src/Doxyfile
+++ b/qt5/src/Doxyfile
@@ -31,7 +31,7 @@ PROJECT_NAME           = "Poppler Qt5"
 # This could be handy for archiving the generated documentation or
 # if some version control system is used.
 
-PROJECT_NUMBER         = 0.24.3
+PROJECT_NUMBER         = 0.24.4
 
 # The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute)
 # base path where the generated documentation will be put.
commit a42a13be0a0cda71dc230a73f7b16eb4eb066251
Author: suzuki toshiya <mpsuzuki at hiroshima-u.ac.jp>
Date:   Wed Nov 27 00:05:57 2013 +0100

    Warn the user if he provides a wrong range

diff --git a/utils/pdffonts.cc b/utils/pdffonts.cc
index 820abbf..535bf8f 100644
--- a/utils/pdffonts.cc
+++ b/utils/pdffonts.cc
@@ -17,6 +17,7 @@
 // Copyright (C) 2007-2008, 2010 Albert Astals Cid <aacid at kde.org>
 // Copyright (C) 2010 Hib Eris <hib at hiberis.nl>
 // Copyright (C) 2012 Adrian Johnson <ajohnson at redneon.com>
+// Copyright (C) 2013 Suzuki Toshiya <mpsuzuki at 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
@@ -150,6 +151,12 @@ int main(int argc, char *argv[]) {
   if (lastPage < 1 || lastPage > doc->getNumPages()) {
     lastPage = doc->getNumPages();
   }
+  if (lastPage < firstPage) {
+    fprintf(stderr,
+            "Wrong page range given: the first page (%d) can not be after the last page (%d).\n",
+            firstPage, lastPage);
+    goto err1;
+  }
 
   // get the fonts
   {
diff --git a/utils/pdfimages.cc b/utils/pdfimages.cc
index 82c301c..e898985 100644
--- a/utils/pdfimages.cc
+++ b/utils/pdfimages.cc
@@ -19,6 +19,7 @@
 // Copyright (C) 2010 Hib Eris <hib at hiberis.nl>
 // Copyright (C) 2010 Jakob Voss <jakob.voss at gbv.de>
 // Copyright (C) 2012 Adrian Johnson <ajohnson at redneon.com>
+// Copyright (C) 2013 Suzuki Toshiya <mpsuzuki at 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
@@ -166,6 +167,12 @@ int main(int argc, char *argv[]) {
     firstPage = 1;
   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 err1;
+  }
 
   // write image files
   imgOut = new ImageOutputDev(imgRoot, pageNames, dumpJPEG, listImages);
diff --git a/utils/pdfinfo.cc b/utils/pdfinfo.cc
index 14e4f6c..68fbd20 100644
--- a/utils/pdfinfo.cc
+++ b/utils/pdfinfo.cc
@@ -19,6 +19,7 @@
 // Copyright (C) 2011 Vittal Aithal <vittal.aithal at cognidox.com>
 // Copyright (C) 2012, 2013 Adrian Johnson <ajohnson at redneon.com>
 // Copyright (C) 2012 Fabio D'Urso <fabiodurso at hotmail.it>
+// Copyright (C) 2013 Suzuki Toshiya <mpsuzuki at 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
@@ -202,6 +203,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);
diff --git a/utils/pdfseparate.cc b/utils/pdfseparate.cc
index d7efcf0..d93ca3e 100644
--- a/utils/pdfseparate.cc
+++ b/utils/pdfseparate.cc
@@ -7,6 +7,7 @@
 // Copyright (C) 2011, 2012 Thomas Freitag <Thomas.Freitag at alfa.de>
 // Copyright (C) 2012, 2013 Albert Astals Cid <aacid at kde.org>
 // Copyright (C) 2013 Pino Toscano <pino at kde.org>
+// Copyright (C) 2013 Suzuki Toshiya <mpsuzuki at hiroshima-u.ac.jp>
 //
 //========================================================================
 #include "config.h"
@@ -63,6 +64,12 @@ bool extractPages (const char *srcFileName, const char *destFileName) {
     lastPage = doc->getNumPages();
   if (firstPage == 0)
     firstPage = 1;
+  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);
+    return false;
+  }
   if (firstPage != lastPage && strstr(destFileName, "%d") == NULL) {
     error(errSyntaxError, -1, "'{0:s}' must contain '%d' if more than one page should be extracted", destFileName);
     return false;
diff --git a/utils/pdftocairo.cc b/utils/pdftocairo.cc
index e1fb258..86e413c 100644
--- a/utils/pdftocairo.cc
+++ b/utils/pdftocairo.cc
@@ -27,6 +27,7 @@
 // Copyright (C) 2011 Carlos Garcia Campos <carlosgc at gnome.org>
 // Copyright (C) 2012 Koji Otani <sho at bbr.jp>
 // Copyright (C) 2013 Lu Wang <coolwanglu at gmail.com>
+// Copyright (C) 2013 Suzuki Toshiya <mpsuzuki at 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
@@ -964,6 +965,12 @@ int main(int argc, char *argv[]) {
   if (lastPage < 1 || lastPage > doc->getNumPages())
     lastPage = doc->getNumPages();
 
+  if (lastPage < firstPage) {
+    fprintf(stderr,
+            "Wrong page range given: the first page (%d) can not be after the last page (%d).\n",
+            firstPage, lastPage);
+    exit(99);
+  }
   if (eps && firstPage != lastPage) {
     fprintf(stderr, "EPS files can only contain one page.\n");
     exit(99);
diff --git a/utils/pdftohtml.cc b/utils/pdftohtml.cc
index bcec8cb..5f39e95 100644
--- a/utils/pdftohtml.cc
+++ b/utils/pdftohtml.cc
@@ -16,7 +16,7 @@
 // Copyright (C) 2007-2008, 2010, 2012 Albert Astals Cid <aacid at kde.org>
 // Copyright (C) 2010 Hib Eris <hib at hiberis.nl>
 // Copyright (C) 2010 Mike Slegeir <tehpola at yahoo.com>
-// Copyright (C) 2010 Suzuki Toshiya <mpsuzuki at hiroshima-u.ac.jp>
+// Copyright (C) 2010, 2013 Suzuki Toshiya <mpsuzuki at hiroshima-u.ac.jp>
 // Copyright (C) 2010 OSSD CDAC Mumbai by Leena Chourey (leenac at cdacmumbai.in) and Onkar Potdar (onkar at cdacmumbai.in)
 // Copyright (C) 2011 Steven Murdoch <Steven.Murdoch at cl.cam.ac.uk>
 // Copyright (C) 2012 Igor Slepchin <igor.redhat at gmail.com>
@@ -322,6 +322,12 @@ int main(int argc, char *argv[]) {
     firstPage = 1;
   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 error;
+  }
 
   doc->getDocInfo(&info);
   if (info.isDict()) {
diff --git a/utils/pdftoppm.cc b/utils/pdftoppm.cc
index 73f337c..e5138d1 100644
--- a/utils/pdftoppm.cc
+++ b/utils/pdftoppm.cc
@@ -25,6 +25,7 @@
 // Copyright (C) 2010 William Bader <williambader at hotmail.com>
 // Copyright (C) 2011-2013 Thomas Freitag <Thomas.Freitag at alfa.de>
 // Copyright (C) 2013 Adam Reichold <adamreichold at myopera.com>
+// Copyright (C) 2013 Suzuki Toshiya <mpsuzuki at 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
@@ -412,6 +413,12 @@ int main(int argc, char *argv[]) {
     lastPage = firstPage;
   if (lastPage < 1 || lastPage > doc->getNumPages())
     lastPage = doc->getNumPages();
+  if (lastPage < firstPage) {
+    fprintf(stderr,
+            "Wrong page range given: the first page (%d) can not be after the last page (%d).\n",
+            firstPage, lastPage);
+    goto err1;
+  }
 
   if (singleFile && firstPage < lastPage) {
     if (!quiet) {
diff --git a/utils/pdftops.cc b/utils/pdftops.cc
index 7f5a0ce..cbe1d36 100644
--- a/utils/pdftops.cc
+++ b/utils/pdftops.cc
@@ -22,6 +22,7 @@
 // Copyright (C) 2009, 2011, 2012 William Bader <williambader at hotmail.com>
 // Copyright (C) 2010 Hib Eris <hib at hiberis.nl>
 // Copyright (C) 2012 Thomas Freitag <Thomas.Freitag at alfa.de>
+// Copyright (C) 2013 Suzuki Toshiya <mpsuzuki at 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
@@ -380,6 +381,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;
+  }
 
   // check for multi-page EPS or form
   if ((doEPS || doForm) && firstPage != lastPage) {
diff --git a/utils/pdftotext.cc b/utils/pdftotext.cc
index 91661d9..7ab6cdd 100644
--- a/utils/pdftotext.cc
+++ b/utils/pdftotext.cc
@@ -291,6 +291,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 err3;
+  }
 
   // write HTML header
   if (htmlMeta) {
commit 45552cafaeef6b883078db269437586add1dc32c
Author: Albert Astals Cid <aacid at kde.org>
Date:   Tue Nov 26 23:36:12 2013 +0100

    Update copyrights

diff --git a/utils/pdftotext.cc b/utils/pdftotext.cc
index bd687ec..91661d9 100644
--- a/utils/pdftotext.cc
+++ b/utils/pdftotext.cc
@@ -23,6 +23,7 @@
 // Copyright (C) 2011 Tom Gleason <tom at buildadam.com>
 // Copyright (C) 2011 Steven Murdoch <Steven.Murdoch at cl.cam.ac.uk>
 // Copyright (C) 2013 Yury G. Kudryashov <urkud.urkud at gmail.com>
+// Copyright (C) 2013 Suzuki Toshiya <mpsuzuki at 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


More information about the poppler mailing list