[poppler] poppler/JBIG2Stream.cc

Albert Astals Cid aacid at kemper.freedesktop.org
Tue Jun 20 21:43:55 UTC 2017


 poppler/JBIG2Stream.cc |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit 40cc2ecfb925ba308f72b25c693ba98d58806ff2
Author: Albert Astals Cid <aacid at kde.org>
Date:   Tue Jun 20 23:43:23 2017 +0200

    Fix crash on broken documents
    
    Fixes bug #101524

diff --git a/poppler/JBIG2Stream.cc b/poppler/JBIG2Stream.cc
index d26ba02b..067fb7f0 100644
--- a/poppler/JBIG2Stream.cc
+++ b/poppler/JBIG2Stream.cc
@@ -15,7 +15,7 @@
 //
 // Copyright (C) 2006 Raj Kumar <rkumar at archive.org>
 // Copyright (C) 2006 Paul Walmsley <paul at booyaka.com>
-// Copyright (C) 2006-2010, 2012, 2014-2016 Albert Astals Cid <aacid at kde.org>
+// Copyright (C) 2006-2010, 2012, 2014-2017 Albert Astals Cid <aacid at kde.org>
 // Copyright (C) 2009 David Benjamin <davidben at mit.edu>
 // Copyright (C) 2011 Edward Jiang <ejiang at google.com>
 // Copyright (C) 2012 William Bader <williambader at hotmail.com>
@@ -1304,7 +1304,7 @@ Goffset JBIG2Stream::getPos() {
 int JBIG2Stream::getChars(int nChars, Guchar *buffer) {
   int n, i;
 
-  if (nChars <= 0) {
+  if (nChars <= 0 || !dataPtr) {
     return 0;
   }
   if (dataEnd - dataPtr < nChars) {


More information about the poppler mailing list