Skip to content

Commit 9e4c858

Browse files
committed
Sanity check HWResolution when writing Apple Raster.
1 parent 1fc833b commit 9e4c858

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

cups/raster-stream.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1268,6 +1268,9 @@ _cupsRasterWriteHeader(
12681268

12691269
if (r->mode == CUPS_RASTER_WRITE_APPLE)
12701270
{
1271+
if (r->header.HWResolution[0] == 0 || r->header.HWResolution[1] == 0)
1272+
return (0);
1273+
12711274
r->rowheight = r->header.HWResolution[0] / r->header.HWResolution[1];
12721275

12731276
if (r->header.HWResolution[0] != (r->rowheight * r->header.HWResolution[1]))

0 commit comments

Comments
 (0)