From 792145c4608f83457053adbddb0ba5c461d92f2a Mon Sep 17 00:00:00 2001 From: kramm Date: Thu, 5 Aug 2004 19:39:20 +0000 Subject: [PATCH] fixed windows access violation which occurs if one tries to retrieve all 256 palette entries on an optimized palette. --- pdf2swf/xpdf/GfxState.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pdf2swf/xpdf/GfxState.cc b/pdf2swf/xpdf/GfxState.cc index 1668c24..a6018be 100644 --- a/pdf2swf/xpdf/GfxState.cc +++ b/pdf2swf/xpdf/GfxState.cc @@ -1664,7 +1664,7 @@ GfxImageColorMap::GfxImageColorMap(int bitsA, Object *decode, colorSpace2 = indexedCS->getBase(); indexHigh = indexedCS->getIndexHigh(); nComps2 = colorSpace2->getNComps(); - lookup = (double *)gmalloc((indexHigh + 1) * nComps2 * sizeof(double)); + lookup = (double *)gmalloc((maxPixel + 1) * nComps2 * sizeof(double)); lookup2 = indexedCS->getLookup(); for (i = 0; i <= indexHigh; ++i) { j = (int)(decodeLow[0] +(i * decodeRange[0]) / maxPixel + 0.5); @@ -1728,6 +1728,7 @@ void GfxImageColorMap::getGray(Guchar *x, double *gray) { } void GfxImageColorMap::getRGB(Guchar *x, GfxRGB *rgb) { + GfxColor color; double *p; int i; -- 1.7.10.4