/*
- * "$Id: image-sgi.c 5509 2006-05-11 11:41:36Z mike $"
+ * "$Id: image-sgi.c 7223 2008-01-16 23:41:19Z mike $"
*
- * SGI image file routines for the Common UNIX Printing System (CUPS).
+ * SGI image file routines for CUPS.
*
- * Copyright 1993-2006 by Easy Software Products.
+ * Copyright 2007-2011 by Apple Inc.
+ * Copyright 1993-2007 by Easy Software Products.
*
* These coded instructions, statements, and computer programs are the
- * property of Easy Software Products and are protected by Federal
- * copyright law. Distribution and use rights are outlined in the file
- * "LICENSE.txt" which should have been included with this file. If this
- * file is missing or damaged please contact Easy Software Products
- * at:
- *
- * Attn: CUPS Licensing Information
- * Easy Software Products
- * 44141 Airport View Drive, Suite 204
- * Hollywood, Maryland 20636 USA
- *
- * Voice: (301) 373-9600
- * EMail: cups-info@cups.org
- * WWW: http://www.cups.org
+ * property of Apple Inc. and are protected by Federal copyright
+ * law. Distribution and use rights are outlined in the file "LICENSE.txt"
+ * which should have been included with this file. If this file is
+ * file is missing or damaged, see the license at "http://www.cups.org/".
*
* This file is subject to the Apple OS-Developed Software exception.
*
if (sgip->xsize == 0 || sgip->ysize == 0 ||
sgip->zsize == 0 || sgip->zsize > 4)
{
- fprintf(stderr, "ERROR: Bad SGI image dimensions %ux%ux%u!\n",
+ fprintf(stderr, "DEBUG: Bad SGI image dimensions %ux%ux%u!\n",
sgip->xsize, sgip->ysize, sgip->zsize);
sgiClose(sgip);
- fclose(fp);
return (1);
}
cupsImageSetMaxTiles(img, 0);
bpp = cupsImageGetDepth(img);
- in = malloc(img->xsize * sgip->zsize);
- out = malloc(img->xsize * bpp);
- rows[0] = calloc(img->xsize * sgip->zsize, sizeof(unsigned short));
+ if ((in = malloc(img->xsize * sgip->zsize)) == NULL)
+ {
+ fputs("DEBUG: Unable to allocate memory!\n", stderr);
+ sgiClose(sgip);
+ return (1);
+ }
+
+ if ((out = malloc(img->xsize * bpp)) == NULL)
+ {
+ fputs("DEBUG: Unable to allocate memory!\n", stderr);
+ sgiClose(sgip);
+ free(in);
+ return (1);
+ }
+
+ if ((rows[0] = calloc(img->xsize * sgip->zsize,
+ sizeof(unsigned short))) == NULL)
+ {
+ fputs("DEBUG: Unable to allocate memory!\n", stderr);
+ sgiClose(sgip);
+ free(in);
+ free(out);
+ return (1);
+ }
+
for (i = 1; i < sgip->zsize; i ++)
rows[i] = rows[0] + i * img->xsize;
/*
- * End of "$Id: image-sgi.c 5509 2006-05-11 11:41:36Z mike $".
+ * End of "$Id: image-sgi.c 7223 2008-01-16 23:41:19Z mike $".
*/