From: Matthias Kramm Date: Thu, 21 Jan 2010 23:31:38 +0000 (-0800) Subject: fixed jbig memory alloc problem X-Git-Tag: version-0-9-1~179 X-Git-Url: http://git.asbjorn.it/?a=commitdiff_plain;h=4de6f0dccaa56db82195ff4b2a8111324a9dd107;p=swftools.git fixed jbig memory alloc problem --- 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 *));