[poppler] poppler/JBIG2Stream.cc

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Wed Nov 18 19:21:59 UTC 2020


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

New commits:
commit 15960417f2fef7e8b94acda712e65e9b5383494c
Author: Albert Astals Cid <aacid at kde.org>
Date:   Wed Nov 18 20:14:37 2020 +0100

    JBIG2Stream::readTextRegion: Fix integer overflow on broken files

diff --git a/poppler/JBIG2Stream.cc b/poppler/JBIG2Stream.cc
index a80806c4..ae7d6306 100644
--- a/poppler/JBIG2Stream.cc
+++ b/poppler/JBIG2Stream.cc
@@ -2240,7 +2240,9 @@ JBIG2Bitmap *JBIG2Stream::readTextRegion(bool huff, bool refine, int w, int h, u
         } else {
             arithDecoder->decodeInt(&ds, iafsStats);
         }
-        sFirst += ds;
+        if (unlikely(checkedAdd(sFirst, ds, &sFirst))) {
+            return nullptr;
+        }
         s = sFirst;
 
         // read the instances


More information about the poppler mailing list