Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions cupsfilters/image-zoom.c
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,9 @@ _cupsImageZoomNew(
if (xsize > CUPS_IMAGE_MAX_WIDTH ||
ysize > CUPS_IMAGE_MAX_HEIGHT ||
(xc1 - xc0) > CUPS_IMAGE_MAX_WIDTH ||
(yc1 - yc0) > CUPS_IMAGE_MAX_HEIGHT)
return (NULL); /* Protect against integer overflow */
(yc1 - yc0) > CUPS_IMAGE_MAX_HEIGHT ||
xsize == 0 || ysize == 0)
return (NULL); /* Protect against integer overflow and divide by zero */

if ((z = (cups_izoom_t *)calloc(1, sizeof(cups_izoom_t))) == NULL)
return (NULL);
Expand Down
2 changes: 2 additions & 0 deletions filter/imagetoraster.c
Original file line number Diff line number Diff line change
Expand Up @@ -1437,6 +1437,8 @@ main(int argc, /* I - Number of command-line arguments */
z = _cupsImageZoomNew(img, xc0, yc0, xc1, yc1, xtemp, ytemp,
Orientation & 1, zoom_type);

if (z == NULL) continue;

/*
* Write leading blank space as needed...
*/
Expand Down