diff options
author | msweet <msweet@a1ca3aef-8c08-0410-bb20-df032aa958be> | 2008-01-17 00:06:33 +0000 |
---|---|---|
committer | msweet <msweet@a1ca3aef-8c08-0410-bb20-df032aa958be> | 2008-01-17 00:06:33 +0000 |
commit | 91c84a3551145559de2956179661e111e373db95 (patch) | |
tree | ea061b2b6ab3b9e4530347e35f5cde3511f8a305 /filter/rastertohp.c | |
parent | 080811b190031b9182e96dc76fc610fadfeaec21 (diff) | |
download | cups-91c84a3551145559de2956179661e111e373db95.tar.gz |
Import CUPS 1.4svn-r7226.
git-svn-id: svn+ssh://src.apple.com/svn/cups/easysw/current@582 a1ca3aef-8c08-0410-bb20-df032aa958be
Diffstat (limited to 'filter/rastertohp.c')
-rw-r--r-- | filter/rastertohp.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/filter/rastertohp.c b/filter/rastertohp.c index 2c41a2652..f35b58ca7 100644 --- a/filter/rastertohp.c +++ b/filter/rastertohp.c @@ -4,7 +4,7 @@ * Hewlett-Packard Page Control Language filter for the Common UNIX * Printing System (CUPS). * - * Copyright 2007 by Apple Inc. + * Copyright 2007-2008 by Apple Inc. * Copyright 1993-2007 by Easy Software Products. * * These coded instructions, statements, and computer programs are the @@ -277,7 +277,7 @@ StartPage(ppd_file_t *ppd, /* I - PPD file */ * Set graphics mode... */ - if (ppd->model_number == 2) + if (ppd && ppd->model_number == 2) { /* * Figure out the number of color planes... @@ -382,7 +382,12 @@ StartPage(ppd_file_t *ppd, /* I - PPD file */ * Allocate memory for a line of graphics... */ - Planes[0] = malloc(header->cupsBytesPerLine); + if ((Planes[0] = malloc(header->cupsBytesPerLine)) == NULL) + { + fputs("ERROR: Unable to allocate memory!\n", stderr); + exit(1); + } + for (plane = 1; plane < NumPlanes; plane ++) Planes[plane] = Planes[0] + plane * header->cupsBytesPerLine / NumPlanes; |