/*
- * "$Id: image-sgilib.c 4741 2005-10-02 04:25:52Z mike $"
+ * "$Id: image-sgilib.c 7221 2008-01-16 22:20:08Z mike $"
*
* SGI image file format library routines for the Common UNIX Printing
* System (CUPS).
*
+ * Copyright 2007-2008 by Apple Inc.
* Copyright 1993-2005 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.
*
fseek(sgip->file, 512, SEEK_SET);
- sgip->table = calloc(sgip->zsize, sizeof(long *));
- sgip->table[0] = calloc(sgip->ysize * sgip->zsize, sizeof(long));
+ if ((sgip->table = calloc(sgip->zsize, sizeof(long *))) == NULL)
+ {
+ free(sgip);
+ return (NULL);
+ }
+
+ if ((sgip->table[0] = calloc(sgip->ysize * sgip->zsize,
+ sizeof(long))) == NULL)
+ {
+ free(sgip->table);
+ free(sgip);
+ return (NULL);
+ }
+
for (i = 1; i < sgip->zsize; i ++)
sgip->table[i] = sgip->table[0] + i * sgip->ysize;
sgip->firstrow = ftell(sgip->file);
sgip->nextrow = ftell(sgip->file);
- sgip->table = calloc(sgip->zsize, sizeof(long *));
- sgip->table[0] = calloc(sgip->ysize * sgip->zsize, sizeof(long));
+ if ((sgip->table = calloc(sgip->zsize, sizeof(long *))) == NULL)
+ {
+ free(sgip);
+ return (NULL);
+ }
+
+ if ((sgip->table[0] = calloc(sgip->ysize * sgip->zsize,
+ sizeof(long))) == NULL)
+ {
+ free(sgip->table);
+ free(sgip);
+ return (NULL);
+ }
+
for (i = 1; i < sgip->zsize; i ++)
sgip->table[i] = sgip->table[0] + i * sgip->ysize;
- sgip->length = calloc(sgip->zsize, sizeof(long *));
- sgip->length[0] = calloc(sgip->ysize * sgip->zsize, sizeof(long));
+
+ if ((sgip->length = calloc(sgip->zsize, sizeof(long *))) == NULL)
+ {
+ free(sgip->table);
+ free(sgip);
+ return (NULL);
+ }
+
+ if ((sgip->length[0] = calloc(sgip->ysize * sgip->zsize,
+ sizeof(long))) == NULL)
+ {
+ free(sgip->length);
+ free(sgip->table);
+ free(sgip);
+ return (NULL);
+ }
+
for (i = 1; i < sgip->zsize; i ++)
sgip->length[i] = sgip->length[0] + i * sgip->ysize;
break;
/*
- * End of "$Id: image-sgilib.c 4741 2005-10-02 04:25:52Z mike $".
+ * End of "$Id: image-sgilib.c 7221 2008-01-16 22:20:08Z mike $".
*/