/*
- * "$Id: raster.c 12124 2014-08-28 15:37:22Z msweet $"
+ * "$Id: raster.c 12453 2015-01-30 15:42:19Z msweet $"
*
* Raster file routines for CUPS.
*
- * Copyright 2007-2014 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.
*/
if (!cups_raster_read_header(r))
+ {
+ memset(h, 0, sizeof(cups_page_header_t));
return (0);
+ }
/*
* Copy the header to the user-supplied buffer...
*/
if (!cups_raster_read_header(r))
+ {
+ memset(h, 0, sizeof(cups_page_header2_t));
return (0);
+ }
/*
* Copy the header to the user-supplied buffer...
fh.cupsInteger[15] = htonl(r->header.cupsInteger[15]);
/* VendorLength */
- memcpy(fh.cupsReal, r->header.cupsReal,
- sizeof(fh.cupsReal) + sizeof(fh.cupsString));
+ void *dst = fh.cupsReal; /* Bypass bogus compiler warning */
+ void *src = r->header.cupsReal;
+ memcpy(dst, src, sizeof(fh.cupsReal) + sizeof(fh.cupsString));
/* VendorData */
strlcpy(fh.cupsRenderingIntent, r->header.cupsRenderingIntent,
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);
}
/*
- * End of "$Id: raster.c 12124 2014-08-28 15:37:22Z msweet $".
+ * End of "$Id: raster.c 12453 2015-01-30 15:42:19Z msweet $".
*/