Fixes crashing of imagetopdf when ppd is not provided
@@ -964,8 +964,8 @@ main(int argc, /* I - Number of command-line arguments */
int fidelity = 0;
int document_large = 0;
- if(ppd->custom_margins[0]||ppd->custom_margins[1]||
- ppd->custom_margins[2]||ppd->custom_margins[3]) // In case of custom margins
+ if(ppd && (ppd->custom_margins[0]||ppd->custom_margins[1]||
+ ppd->custom_margins[2]||ppd->custom_margins[3])) // In case of custom margins
margin_defined = 1;
if(PageLength!=PageTop-PageBottom||PageWidth!=PageRight-PageLeft)
margin_defined = 1;
