From: Michael R Sweet Date: Sun, 5 Apr 2026 13:46:32 +0000 (-0400) Subject: Sanity check HWResolution when writing Apple Raster. X-Git-Url: http://git.ipfire.org/gitweb/index.cgi?a=commitdiff_plain;h=9e4c8585d47c7e554f2cb656e81462f053eb1699;p=thirdparty%2Fcups.git Sanity check HWResolution when writing Apple Raster. --- diff --git a/cups/raster-stream.c b/cups/raster-stream.c index 04a9b19c76..3f897d49a1 100644 --- a/cups/raster-stream.c +++ b/cups/raster-stream.c @@ -1268,6 +1268,9 @@ _cupsRasterWriteHeader( if (r->mode == CUPS_RASTER_WRITE_APPLE) { + if (r->header.HWResolution[0] == 0 || r->header.HWResolution[1] == 0) + return (0); + r->rowheight = r->header.HWResolution[0] / r->header.HWResolution[1]; if (r->header.HWResolution[0] != (r->rowheight * r->header.HWResolution[1]))