[gs-cvs] rev 8246 - trunk/gs/src
leonardo at ghostscript.com
leonardo at ghostscript.com
Thu Sep 20 01:49:50 PDT 2007
Author: leonardo
Date: 2007-09-20 01:49:49 -0700 (Thu, 20 Sep 2007)
New Revision: 8246
Modified:
trunk/gs/src/gdevpsdi.c
Log:
Fix (pdfwrite) : Allow image encoding filter initialization with no parameters passed from the client.
DETAILS :
Bug 689458 "pdfwrite image crash (pcl and xps)".
The change 6122 doesn't account that some client
may pass no parameters for filter initialization.
Fixing it now and improve the documentation.
EXPECTED DIFFERENCES :
None,
Modified: trunk/gs/src/gdevpsdi.c
===================================================================
--- trunk/gs/src/gdevpsdi.c 2007-09-18 19:11:21 UTC (rev 8245)
+++ trunk/gs/src/gdevpsdi.c 2007-09-20 08:49:49 UTC (rev 8246)
@@ -121,10 +121,12 @@
if (pcs->type->num_components(pcs) != 3)
return 0;
- /* Make a copy of the parameter list since we will modify it. */
- code = param_list_copy((gs_param_list *)list, (gs_param_list *)*param);
- if (code < 0)
- return code;
+ if (*param != NULL) {
+ /* Make a copy of the parameter list since we will modify it. */
+ code = param_list_copy((gs_param_list *)list, (gs_param_list *)*param);
+ if (code < 0)
+ return code;
+ }
*param = list;
/* Create a local memory device for transforming colors to DeviceRGB. */
@@ -255,7 +257,7 @@
return gs_error_rangecheck; /* Reject the alternative stream. */
if (pdev->version < psdf_version_ll3 && template == &s_zlibE_template)
orig_template = template = lossless_template;
- if (dict) /* NB: rather than dereference NULL lets continue on without a dict */
+ if (dict != NULL) /* Some interpreters don't supply filter parameters. */
gs_c_param_list_read(dict); /* ensure param list is in read mode */
if (template == 0) /* no compression */
return 0;
More information about the gs-cvs
mailing list