[gs-cvs] rev 8292 - trunk/gs/src

ray at ghostscript.com ray at ghostscript.com
Mon Oct 15 11:09:18 PDT 2007


Author: ray
Date: 2007-10-15 11:09:18 -0700 (Mon, 15 Oct 2007)
New Revision: 8292

Modified:
   trunk/gs/src/gdevp14.c
Log:
Prevent C-stack overflow caused by infinite recursion. Related to
previous fix in same function to access the correct target color
procedure.

DETAILS:

Testing with other problem files detected the recursion. The previous
method to access the saved target get_color_comp_index is moved
before either use.

EXPECTED DIFFRENCES:

None.


Modified: trunk/gs/src/gdevp14.c
===================================================================
--- trunk/gs/src/gdevp14.c	2007-10-15 13:11:16 UTC (rev 8291)
+++ trunk/gs/src/gdevp14.c	2007-10-15 18:09:18 UTC (rev 8292)
@@ -4308,13 +4308,15 @@
     int comp_index;
     dev_proc_get_color_comp_index(*target_get_color_comp_index) = dev_proc(tdev, get_color_comp_index);
 
+    /* The pdf14_clist_create_compositor may have set the color procs. We need the real target procs */
+    if (target_get_color_comp_index == pdf14_cmykspot_get_color_comp_index)
+	target_get_color_comp_index = ((pdf14_clist_device *)pdev)->saved_target_get_color_comp_index;
     /*
      * If this is not a separation name then simply forward it to the target
      * device.
      */
     if (component_type == NO_COMP_NAME_TYPE)
-	return dev_proc(tdev, get_color_comp_index)
-				(tdev, pname, name_size, component_type);
+	return  (*target_get_color_comp_index)(tdev, pname, name_size, component_type);
     /*
      * Check if the component is in either the process color model list
      * or in the SeparationNames list.
@@ -4329,9 +4331,6 @@
     /*
      * If we do not know this color, check if the output (target) device does.
      */
-    
-    if (target_get_color_comp_index == pdf14_cmykspot_get_color_comp_index)
-	target_get_color_comp_index = ((pdf14_clist_device *)pdev)->saved_target_get_color_comp_index;
     comp_index = (*target_get_color_comp_index)(tdev, pname, name_size, component_type);
     /*
      * Ignore color if unknown to the output device or if color is not being



More information about the gs-cvs mailing list