]> git.ipfire.org Git - thirdparty/cups.git/commitdiff
Sanity check HWResolution when writing Apple Raster.
authorMichael R Sweet <msweet@msweet.org>
Sun, 5 Apr 2026 13:46:32 +0000 (09:46 -0400)
committerMichael R Sweet <msweet@msweet.org>
Sun, 5 Apr 2026 13:46:32 +0000 (09:46 -0400)
cups/raster-stream.c

index 04a9b19c765d6d30b5cd0f6b50748b31dfd05fdd..3f897d49a199f4f900cd64ac1300cb28cc3c7bac 100644 (file)
@@ -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]))