From 4de6f0dccaa56db82195ff4b2a8111324a9dd107 Mon Sep 17 00:00:00 2001 From: Matthias Kramm Date: Thu, 21 Jan 2010 15:31:38 -0800 Subject: [PATCH] fixed jbig memory alloc problem --- lib/pdf/xpdf-changes.patch | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/lib/pdf/xpdf-changes.patch b/lib/pdf/xpdf-changes.patch index 9068a67..560d709 100644 --- a/lib/pdf/xpdf-changes.patch +++ b/lib/pdf/xpdf-changes.patch @@ -994,3 +994,35 @@ diff -u -r1.5 -r1.6 // End a page. virtual void endPage(); +--- xpdf/JBIG2Stream.cc.orig 2010-01-08 17:17:18.000000000 -0800 ++++ xpdf/JBIG2Stream.cc 2010-01-21 15:28:26.000000000 -0800 +@@ -1514,11 +1514,14 @@ + } + + // compute symbol code length +- symCodeLen = 1; +- i = (numInputSyms + numNewSyms) >> 1; +- while (i) { +- ++symCodeLen; +- i >>= 1; ++ symCodeLen = 0; ++ i = 1; ++ while (i < numInputSyms + numNewSyms) { ++ ++symCodeLen; ++ i <<= 1; ++ } ++ if (huff && symCodeLen == 0) { ++ symCodeLen = 1; + } + + // get the input symbol bitmaps +@@ -1921,6 +1924,9 @@ + ++symCodeLen; + i <<= 1; + } ++ if (huff && symCodeLen == 0) { ++ symCodeLen = 1; ++ } + + // get the symbol bitmaps + syms = (JBIG2Bitmap **)gmallocn(numSyms, sizeof(JBIG2Bitmap *)); -- 1.7.10.4