[poppler] Branch 'xpdf303merge' - poppler/JBIG2Stream.cc

Albert Astals Cid aacid at kemper.freedesktop.org
Mon Sep 5 10:43:01 PDT 2011


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

New commits:
commit 7b77a264b5c21ba693677b1249a2122743e4e395
Author: Albert Astals Cid <aacid at kde.org>
Date:   Mon Sep 5 19:46:16 2011 +0200

    xpdf303: segments with unspecified length

diff --git a/poppler/JBIG2Stream.cc b/poppler/JBIG2Stream.cc
index a0450a9..96c8ad3 100644
--- a/poppler/JBIG2Stream.cc
+++ b/poppler/JBIG2Stream.cc
@@ -2662,7 +2662,7 @@ void JBIG2Stream::readHalftoneRegionSeg(Guint segNum, GBool imm,
 void JBIG2Stream::readGenericRegionSeg(Guint segNum, GBool imm,
 				       GBool lossless, Guint length) {
   JBIG2Bitmap *bitmap;
-  Guint w, h, x, y, segInfoFlags, extCombOp;
+  Guint w, h, x, y, segInfoFlags, extCombOp, rowCount;
   Guint flags, mmr, templ, tpgdOn;
   int atx[4], aty[4];
 
@@ -2729,6 +2729,12 @@ void JBIG2Stream::readGenericRegionSeg(Guint segNum, GBool imm,
     segments->append(bitmap);
   }
 
+  // immediate generic segments can have an unspecified length, in
+  // which case, a row count is stored at the end of the segment
+  if (imm && length == 0xffffffff) {
+    readULong(&rowCount);
+  }
+
   return;
 
  eofError:


More information about the poppler mailing list