signal(SIGPIPE, SIG_IGN);
-/*
+ /*
* Process job options...
*/
- if (set_pstops_options(&doc, filter_data_ext->ppd,
+ if (set_pstops_options(&doc, (filter_data_ext ? filter_data_ext->ppd : NULL),
data->job_id, data->job_user,
data->job_title, data->copies,
data->num_options, data->options,
* Write any "exit server" options that have been selected...
*/
- ppdEmit(filter_data_ext->ppd, outputfp, PPD_ORDER_EXIT);
+ if (filter_data_ext)
+ ppdEmit(filter_data_ext->ppd, outputfp, PPD_ORDER_EXIT);
/*
* Write any JCL commands that are needed to print PostScript code...
*/
- if (doc.emit_jcl)
+ if (filter_data_ext && doc.emit_jcl)
ppdEmitJCL(filter_data_ext->ppd, outputfp, doc.job_id, doc.user, doc.title);
/*
* Yes, filter the document...
*/
- copy_dsc(&doc, filter_data_ext->ppd, line, len, sizeof(line));
+ if (filter_data_ext)
+ copy_dsc(&doc, filter_data_ext->ppd, line, len, sizeof(line));
}
else
{
* a single page...
*/
- copy_non_dsc(&doc, filter_data_ext->ppd, line, len, sizeof(line));
+ if (filter_data_ext)
+ copy_non_dsc(&doc, filter_data_ext->ppd, line, len, sizeof(line));
}
/*
if (doc.emit_jcl)
{
- if (filter_data_ext->ppd && filter_data_ext->ppd->jcl_end)
+ if (filter_data_ext && filter_data_ext->ppd &&
+ filter_data_ext->ppd->jcl_end)
ppdEmitJCLEnd(filter_data_ext->ppd, doc.outputfp);
else
doc_putc(&doc, 0x04);
int colorspace; /* Output colorspace */
int out_offset, /* Offset into output buffer */
out_length; /* Length of output buffer */
- ppd_file_t *ppd; /* PPD file */
+ ppd_file_t *ppd = NULL; /* PPD file */
ppd_choice_t *choice; /* PPD option choice */
int num_options; /* Number of print options */
cups_option_t *options; /* Print options */
* Process job options...
*/
- ppd = filter_data_ext->ppd;
+ if (filter_data_ext)
+ ppd = filter_data_ext->ppd;
ppdFilterSetCommonOptions(ppd, num_options, options, 0,
&doc.Orientation, &doc.Duplex,
&doc.LanguageLevel, &doc.Color,
cf_filter_data_t pstops_filter_data;
int ret;
const char *val; /* Option value */
- ppd_file_t *ppd; /* PPD file */
+ ppd_file_t *ppd = NULL; /* PPD file */
char resolution[128] = ""; /* Output resolution */
int xres = 0, yres = 0, /* resolution values */
mres, res,
num_options = cfJoinJobOptionsAndAttrs(data, num_options, &options);
- ppd = filter_data_ext->ppd;
+ if (filter_data_ext)
+ ppd = filter_data_ext->ppd;
/*
* Process job options...