[poppler] 2 commits - poppler/Stream.cc

Albert Astals Cid aacid at kemper.freedesktop.org
Sat Jun 1 04:47:38 PDT 2013


 poppler/Stream.cc |    5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

New commits:
commit 01a825f3f9f5dcf686fc123d2cf80b9c525d0d89
Merge: a57f937 b4b1310
Author: Albert Astals Cid <aacid at kde.org>
Date:   Sat Jun 1 13:47:29 2013 +0200

    Merge remote-tracking branch 'origin/poppler-0.22'

commit b4b13102716cd33636a94fd99c49487924761670
Author: Albert Astals Cid <aacid at kde.org>
Date:   Sat Jun 1 13:45:53 2013 +0200

    Fix crash on malformed file
    
    Also remove outdated comment
    
    Bug #65221

diff --git a/poppler/Stream.cc b/poppler/Stream.cc
index ffe2638..8eb91bb 100644
--- a/poppler/Stream.cc
+++ b/poppler/Stream.cc
@@ -421,7 +421,6 @@ ImageStream::ImageStream(Stream *strA, int widthA, int nCompsA, int nBitsA) {
   nVals = width * nComps;
   inputLineSize = (nVals * nBits + 7) >> 3;
   if (nBits <= 0 || nVals > INT_MAX / nBits - 7) {
-    // force a call to gmallocn(-1,...), which will throw an exception
     inputLineSize = -1;
   }
   inputLine = (Guchar *)gmallocn_checkoverflow(inputLineSize, sizeof(char));
@@ -478,6 +477,10 @@ Guchar *ImageStream::getLine() {
   int c;
   int i;
   Guchar *p;
+  
+  if (unlikely(inputLine == NULL)) {
+      return NULL;
+  }
  
   int readChars = str->doGetChars(inputLineSize, inputLine);
   for ( ; readChars < inputLineSize; readChars++) inputLine[readChars] = EOF;


More information about the poppler mailing list