[poppler] poppler/JBIG2Stream.cc

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Sat Dec 19 17:03:07 UTC 2020


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

New commits:
commit 009fab09ae7ec188b4ead67b006ac11d0f518b08
Author: Oliver Sander <oliver.sander at tu-dresden.de>
Date:   Sat Dec 19 10:10:04 2020 +0100

    JBIG2Reader: Handle segment type 51 ('end of file')
    
    Imported from xpdf-4.02.

diff --git a/poppler/JBIG2Stream.cc b/poppler/JBIG2Stream.cc
index 64dac1fe..453d2c87 100644
--- a/poppler/JBIG2Stream.cc
+++ b/poppler/JBIG2Stream.cc
@@ -1248,7 +1248,8 @@ void JBIG2Stream::readSegments()
     Goffset segDataPos;
     int c1, c2, c3;
 
-    while (readULong(&segNum)) {
+    bool done = false;
+    while (!done && readULong(&segNum)) {
 
         // segment header flags
         if (!readUByte(&segFlags)) {
@@ -1374,6 +1375,10 @@ void JBIG2Stream::readSegments()
         case 50:
             readEndOfStripeSeg(segLength);
             break;
+        case 51:
+            // end of file segment
+            done = true;
+            break;
         case 52:
             readProfilesSeg(segLength);
             break;


More information about the poppler mailing list