[poppler] poppler/JBIG2Stream.cc

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Sun Nov 15 20:59:57 UTC 2020


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

New commits:
commit bf6909d2d9dc82d3014ce7659469c8e1cc37694c
Author: Albert Astals Cid <aacid at kde.org>
Date:   Sun Nov 15 21:51:25 2020 +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
    very small looping for hours

diff --git a/poppler/JBIG2Stream.cc b/poppler/JBIG2Stream.cc
index d02e5fc5..f267f413 100644
--- a/poppler/JBIG2Stream.cc
+++ b/poppler/JBIG2Stream.cc
@@ -1741,6 +1741,10 @@ bool JBIG2Stream::readSymbolDictSeg(unsigned int segNum, unsigned int length, un
                 } else {
                     bitmaps[numInputSyms + i] = readTextRegion(huff, true, symWidth, symHeight, refAggNum, 0, numInputSyms + i, nullptr, symCodeLen, bitmaps, 0, 0, 0, 1, 0, huffTableF, huffTableH, huffTableK, huffTableO, huffTableO,
                                                                huffTableO, huffTableO, huffTableA, sdrTemplate, sdrATX, sdrATY);
+                    if (unlikely(!bitmaps[numInputSyms + i])) {
+                        error(errSyntaxError, curStr->getPos(), "NULL bitmap in readTextRegion");
+                        goto syntaxError;
+                    }
                 }
 
                 // non-ref/agg coding


More information about the poppler mailing list