Skip to content

Commit e4897e9

Browse files
committed
Sanity check HWResolution when writing Apple Raster.
1 parent c338124 commit e4897e9

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
@@ -1038,6 +1038,9 @@ _cupsRasterWriteHeader(
10381038

10391039
if (r->mode == CUPS_RASTER_WRITE_APPLE)
10401040
{
1041+
if (r->header.HWResolution[0] == 0 || r->header.HWResolution[1] == 0)
1042+
return (0);
1043+
10411044
r->rowheight = r->header.HWResolution[0] / r->header.HWResolution[1];
10421045

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

0 commit comments

Comments
 (0)