summaryrefslogtreecommitdiff
path: root/poppler/GfxState.cc
diff options
context:
space:
mode:
Diffstat (limited to 'poppler/GfxState.cc')
-rw-r--r--poppler/GfxState.cc8
1 files changed, 4 insertions, 4 deletions
diff --git a/poppler/GfxState.cc b/poppler/GfxState.cc
index 8fc8feb5..1ca32895 100644
--- a/poppler/GfxState.cc
+++ b/poppler/GfxState.cc
@@ -1846,13 +1846,13 @@ void GfxIndexedColorSpace::getRGB(GfxColor *color, GfxRGB *rgb) {
void GfxIndexedColorSpace::getRGBLine(Guchar *in, unsigned int *out, int length) {
Guchar *line;
int i, j, n;
n = base->getNComps();
- line = (Guchar *) gmalloc (length * n);
+ line = (Guchar *) gmallocn (length, n);
for (i = 0; i < length; i++)
for (j = 0; j < n; j++)
line[i * n + j] = lookup[in[i] * n + j];
base->getRGBLine(line, out, length);
@@ -4069,13 +4069,13 @@ GfxImageColorMap::GfxImageColorMap(int bitsA, Object *decode,
indexedCS = (GfxIndexedColorSpace *)colorSpace;
colorSpace2 = indexedCS->getBase();
indexHigh = indexedCS->getIndexHigh();
nComps2 = colorSpace2->getNComps();
lookup2 = indexedCS->getLookup();
colorSpace2->getDefaultRanges(x, y, indexHigh);
- byte_lookup = (Guchar *)gmalloc ((maxPixel + 1) * nComps2);
+ byte_lookup = (Guchar *)gmallocn ((maxPixel + 1), nComps2);
for (k = 0; k < nComps2; ++k) {
lookup[k] = (GfxColorComp *)gmallocn(maxPixel + 1,
sizeof(GfxColorComp));
for (i = 0; i <= maxPixel; ++i) {
j = (int)(decodeLow[0] + (i * decodeRange[0]) / maxPixel + 0.5);
if (j < 0) {
@@ -4217,13 +4217,13 @@ void GfxImageColorMap::getGrayLine(Guchar *in, Guchar *out, int length) {
int i, j;
Guchar *inp, *tmp_line;
switch (colorSpace->getMode()) {
case csIndexed:
case csSeparation:
- tmp_line = (Guchar *) gmalloc (length * nComps2);
+ tmp_line = (Guchar *) gmallocn (length, nComps2);
for (i = 0; i < length; i++) {
for (j = 0; j < nComps2; j++) {
tmp_line[i * nComps2 + j] = byte_lookup[in[i] * nComps2 + j];
}
}
colorSpace2->getGrayLine(tmp_line, out, length);
@@ -4247,13 +4247,13 @@ void GfxImageColorMap::getRGBLine(Guchar *in, unsigned int *out, int length) {
int i, j;
Guchar *inp, *tmp_line;
switch (colorSpace->getMode()) {
case csIndexed:
case csSeparation:
- tmp_line = (Guchar *) gmalloc (length * nComps2);
+ tmp_line = (Guchar *) gmallocn (length, nComps2);
for (i = 0; i < length; i++) {
for (j = 0; j < nComps2; j++) {
tmp_line[i * nComps2 + j] = byte_lookup[in[i] * nComps2 + j];
}
}
colorSpace2->getRGBLine(tmp_line, out, length);