[poppler] poppler/JBIG2Stream.cc

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Fri Jul 29 19:03:33 UTC 2022


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

New commits:
commit cb1f2a685461b60e05d503165d05ea6c557ff277
Author: Albert Astals Cid <aacid at kde.org>
Date:   Fri Jul 29 20:59:28 2022 +0200

    JBIG2Stream: Fix crash on broken files
    
    oss-fuzz/49406

diff --git a/poppler/JBIG2Stream.cc b/poppler/JBIG2Stream.cc
index 47889ed5..2266954e 100644
--- a/poppler/JBIG2Stream.cc
+++ b/poppler/JBIG2Stream.cc
@@ -2751,6 +2751,10 @@ void JBIG2Stream::readGenericRegionSeg(unsigned int segNum, bool imm, bool lossl
     if (imm) {
         if (pageH == 0xffffffff && y + h > curPageH) {
             pageBitmap->expand(y + h, pageDefPixel);
+            if (!pageBitmap->isOk()) {
+                error(errSyntaxError, curStr->getPos(), "JBIG2Stream::readGenericRegionSeg: expand failed");
+                return;
+            }
         }
         pageBitmap->combine(bitmap.get(), x, y, extCombOp);
 


More information about the poppler mailing list