Blob Blame Raw
diff -up cups-1.7.5/filter/raster.c.str4551 cups-1.7.5/filter/raster.c
--- cups-1.7.5/filter/raster.c.str4551	2013-05-29 12:51:34.000000000 +0100
+++ cups-1.7.5/filter/raster.c	2015-02-16 15:43:14.790184784 +0000
@@ -3,7 +3,7 @@
  *
  *   Raster file routines for CUPS.
  *
- *   Copyright 2007-2012 by Apple Inc.
+ *   Copyright 2007-2015 by Apple Inc.
  *   Copyright 1997-2006 by Easy Software Products.
  *
  *   This file is part of the CUPS Imaging library.
@@ -281,7 +281,10 @@ cupsRasterReadHeader(
   */
 
   if (!cups_raster_read_header(r))
+  {
+    memset(h, 0, sizeof(cups_page_header_t));
     return (0);
+  }
 
  /*
   * Copy the header to the user-supplied buffer...
@@ -310,7 +313,10 @@ cupsRasterReadHeader2(
   */
 
   if (!cups_raster_read_header(r))
+  {
+    memset(h, 0, sizeof(cups_page_header2_t));
     return (0);
+  }
 
  /*
   * Copy the header to the user-supplied buffer...
@@ -988,7 +994,7 @@ cups_raster_read_header(
 
   cups_raster_update(r);
 
-  return (r->header.cupsBytesPerLine != 0 && r->header.cupsHeight != 0);
+  return (r->header.cupsBytesPerLine != 0 && r->header.cupsHeight != 0 && (r->header.cupsBytesPerLine % r->bpp) == 0);
 }