]> git.ipfire.org Git - thirdparty/cups.git/blobdiff - filter/rastertohp.c
Import CUPS v2.0.3
[thirdparty/cups.git] / filter / rastertohp.c
index c415b4f399f7418495398e3ec516f36d8b036eac..1178688b0711ddb58bbed994e53f6d15342b2def 100644 (file)
@@ -1,9 +1,9 @@
 /*
- * "$Id: rastertohp.c 11558 2014-02-06 18:33:34Z msweet $"
+ * "$Id: rastertohp.c 12575 2015-03-26 16:36:54Z msweet $"
  *
  * Hewlett-Packard Page Control Language filter for CUPS.
  *
- * Copyright 2007-2014 by Apple Inc.
+ * Copyright 2007-2015 by Apple Inc.
  * Copyright 1993-2007 by Easy Software Products.
  *
  * These coded instructions, statements, and computer programs are the
@@ -354,7 +354,7 @@ StartPage(ppd_file_t         *ppd,  /* I - PPD file */
   * Allocate memory for a line of graphics...
   */
 
-  if ((Planes[0] = malloc(header->cupsBytesPerLine)) == NULL)
+  if ((Planes[0] = malloc(header->cupsBytesPerLine + NumPlanes)) == NULL)
   {
     fputs("ERROR: Unable to allocate memory\n", stderr);
     exit(1);
@@ -369,7 +369,7 @@ StartPage(ppd_file_t         *ppd,  /* I - PPD file */
     BitBuffer = NULL;
 
   if (header->cupsCompression)
-    CompBuffer = malloc(header->cupsBytesPerLine * 2);
+    CompBuffer = malloc(header->cupsBytesPerLine * 2 + 2);
   else
     CompBuffer = NULL;
 }
@@ -871,5 +871,5 @@ main(int  argc,                             /* I - Number of command-line arguments */
 
 
 /*
- * End of "$Id: rastertohp.c 11558 2014-02-06 18:33:34Z msweet $".
+ * End of "$Id: rastertohp.c 12575 2015-03-26 16:36:54Z msweet $".
  */