[gs-commits] (xefitra) rev 10503 - branches/icc_work/base

mvrhel at ghostscript.com mvrhel at ghostscript.com
Tue Dec 15 18:51:19 UTC 2009


Author: mvrhel
Date: 2009-12-15 18:51:18 +0000 (Tue, 15 Dec 2009)
New Revision: 10503

Modified:
   branches/icc_work/base/gdevp14.c
Log:
Fix to avoid access violations when we have patterns with transparency.

DETAILS:

Note currently if a pattern space has transparency, the ICC profile is not used for blending purposes.  Instead we rely upon the gray, rgb, or cmyk parent space.  This is primarily due to the fact that pdf14_pop_transparency_group and pdf14_push_transparnecy_group have no real ICC interaction and those are the operations called in the tile transparency code.  Instead we may want to look at using pdf14_begin_transparency_group and pdf14_end_transparency group, which is where all the ICC information is handled.  We will return to look at that later.

Modified: branches/icc_work/base/gdevp14.c
===================================================================
--- branches/icc_work/base/gdevp14.c	2009-12-15 17:31:27 UTC (rev 10502)
+++ branches/icc_work/base/gdevp14.c	2009-12-15 18:51:18 UTC (rev 10503)
@@ -772,6 +772,7 @@
     byte *new_data_buf;
     int num_noncolor_planes, new_num_planes;
     int num_cols, num_rows, num_newcolor_planes;
+    bool icc_match;
 
     gsicc_rendering_param_t rendering_params;
     gsicc_link_t *icc_link;
@@ -845,11 +846,29 @@
 
 #endif
 
+/* Note currently if a pattern space has transparency, the ICC profile is not used
+   for blending purposes.  Instead we rely upon the gray, rgb, or cmyk parent space.
+   This is partially due to the fact that pdf14_pop_transparency_group and
+   pdf14_push_transparnecy_group have no real ICC interaction and those are the
+   operations called in the tile transparency code.  Instead we may want to
+   look at pdf14_begin_transparency_group and pdf14_end_transparency group which
+   is where all the ICC information is handled.  We will return to look at that later */
 
-	/* If the color spaces are different and we actually did do a swap of the procs for color */
+    if ( nos->parent_color_info_procs->icc_profile != NULL ) {
+
+        icc_match = (nos->parent_color_info_procs->icc_profile->hashcode != curr_icc_profile->hashcode);
+
+    } else {
+
+        /* Let the other tests make the decision if we need to transform */
+
+        icc_match = false;
+
+    }
+
+    /* If the color spaces are different and we actually did do a swap of the procs for color */
     if ( (nos->parent_color_info_procs->num_components != curr_num_color_comp && 
-        nos->parent_color_info_procs->parent_color_mapping_procs != NULL) ||
-        nos->parent_color_info_procs->icc_profile->hashcode != curr_icc_profile->hashcode) {
+        nos->parent_color_info_procs->parent_color_mapping_procs != NULL) || icc_match ) {
 
         if (x0 < x1 && y0 < y1) {
 



More information about the gs-commits mailing list