width, -height, height);
// allocate a line buffer
lineBuf = (Guchar *)gmalloc(4 * width);
lineBuf = (Guchar *)gmallocn(width, 4);
// set up to process the data stream
imgStr = new ImageStream(str, width, colorMap->getNumPixelComps(),
} else {
imgLineSize = nVals;
}
imgLine = (Guchar *)gmalloc(imgLineSize * sizeof(Guchar));
if (width > INT_MAX / nComps) {
// force a call to gmallocn(-1,...), which will throw an exception
imgLineSize = -1;
imgLine = (Guchar *)gmallocn(imgLineSize, sizeof(Guchar));
imgIdx = nVals;