From: kramm Date: Thu, 5 Aug 2004 19:39:20 +0000 (+0000) Subject: fixed windows access violation which occurs if one tries to retrieve X-Git-Tag: release-0-6-0~48 X-Git-Url: http://git.asbjorn.biz/?p=swftools.git;a=commitdiff_plain;h=792145c4608f83457053adbddb0ba5c461d92f2a fixed windows access violation which occurs if one tries to retrieve all 256 palette entries on an optimized palette. --- 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;