[poppler] poppler/JBIG2Stream.cc

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Mon Jan 4 22:31:14 UTC 2021


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

New commits:
commit 9bb28091b64c1b19dcdccb63d50593abc15f627a
Author: Albert Astals Cid <aacid at kde.org>
Date:   Mon Jan 4 23:24:36 2021 +0100

    JBIG2Stream::readSymbolDictSeg: Return early if one of the bitmaps is null
    
    Doesn't seem to regress any of the valid files i have and saves some
    broken ones that loop for hours

diff --git a/poppler/JBIG2Stream.cc b/poppler/JBIG2Stream.cc
index 308bf772..db46b1ae 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-2020 Albert Astals Cid <aacid at kde.org>
+// Copyright (C) 2006-2010, 2012, 2014-2021 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>
@@ -1756,6 +1756,10 @@ bool JBIG2Stream::readSymbolDictSeg(unsigned int segNum, unsigned int length, un
                 // non-ref/agg coding
             } else {
                 bitmaps[numInputSyms + i] = readGenericBitmap(false, symWidth, symHeight, sdTemplate, false, false, nullptr, sdATX, sdATY, 0).release();
+                if (unlikely(!bitmaps[numInputSyms + i])) {
+                    error(errSyntaxError, curStr->getPos(), "NULL bitmap in readGenericBitmap");
+                    goto syntaxError;
+                }
             }
 
             ++i;


More information about the poppler mailing list