Skip to content

Commit f633fe8

Browse files
committed
Limit test page resolution from 1 to 9600dpi (Issue #1541)
1 parent bf5c85f commit f633fe8

2 files changed

Lines changed: 4 additions & 2 deletions

File tree

CHANGES.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ Changes in libcups
44
v3.0.2 - YYYY-MM-DD
55
-------------------
66

7+
- Updated `ipptool` to limit the range of supported raster resolutions for the
8+
generated test page content from 1 to 9600dpi.
79
- Fixed a recursion issue with encoding of nested collections.
810

911

tools/ipptool.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3294,7 +3294,7 @@ parse_generate_file(
32943294
}
32953295
}
32963296

3297-
if (!params->xdpi || !params->ydpi)
3297+
if (params->xdpi <= 0 || params->xdpi > 9600 || params->ydpi <= 0 || params->ydpi > 9600)
32983298
{
32993299
print_fatal_error(data, "Printer does not report a supported RESOLUTION on line %d of '%s'.", ippFileGetLineNumber(f), ippFileGetFilename(f));
33003300
goto fail;
@@ -3608,7 +3608,7 @@ parse_generate_file(
36083608
params->xdpi = params->ydpi = 0;
36093609
}
36103610

3611-
if (strcmp(value, "default") && (params->xdpi <= 0 || params->ydpi <= 0))
3611+
if (strcmp(value, "default") && (params->xdpi <= 0 || params->xdpi > 9600 || params->ydpi <= 0 || params->ydpi > 9600))
36123612
{
36133613
print_fatal_error(data, "Bad RESOLUTION \"%s\" on line %d of '%s'.", value, ippFileGetLineNumber(f), ippFileGetFilename(f));
36143614
goto fail;

0 commit comments

Comments
 (0)