Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ppd-emit.c: Fix crash if there is no page size for "Custom" #35

Merged
merged 1 commit into from
Jan 5, 2024
Merged
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
13 changes: 9 additions & 4 deletions ppd/ppd-emit.c
Original file line number Diff line number Diff line change
Expand Up @@ -949,19 +949,24 @@ ppdEmitString(ppd_file_t *ppd, // I - PPD file record
// parameter positions defined in the PPD file...
//

ppd_attr_t *attr; // PPD attribute
ppd_attr_t *attr; // PPD attribute
int pos, // Position of custom value
orientation; // Orientation to use
float values[5]; // Values for custom command


strlcpy(bufptr, "%%BeginFeature: *CustomPageSize True\n",
strlcpy(bufptr, "%%BeginFeature: *CustomPageSize True\n",
(size_t)(bufend - bufptr + 1));
bufptr += 37;

size = ppdPageSize(ppd, "Custom");
if ((size = ppdPageSize(ppd, "Custom")) == NULL)
{
free(buffer);
free(choices);
return (NULL);
}

memset(values, 0, sizeof(values));
memset(values, 0, sizeof(values));

if ((attr = ppdFindAttr(ppd, "ParamCustomPageSize", "Width")) != NULL)
{
Expand Down