[gs-commits] rev 10948 - branches/icc_work/base

mvrhel at ghostscript.com mvrhel at ghostscript.com
Fri Mar 19 19:24:26 UTC 2010


Author: mvrhel
Date: 2010-03-19 19:24:25 +0000 (Fri, 19 Mar 2010)
New Revision: 10948

Modified:
   branches/icc_work/base/gdevp14.c
   branches/icc_work/base/gstrans.c
Log:
Fix for seg faults caused by trying to set the background content which did not account for the fact that all the softmasks are now rendered into a gray buffer.

Modified: branches/icc_work/base/gdevp14.c
===================================================================
--- branches/icc_work/base/gdevp14.c	2010-03-19 18:59:38 UTC (rev 10947)
+++ branches/icc_work/base/gdevp14.c	2010-03-19 19:24:25 UTC (rev 10948)
@@ -932,8 +932,7 @@
                              const float GrayBackground)
 {
     pdf14_buf *buf;
-    unsigned char *curr_ptr;
-    int k;
+    unsigned char *curr_ptr, gray;
     unsigned char background_init;
     
     if_debug2('v', "[v]pdf14_push_transparency_mask, idle=%d, replacing=%d\n", 
@@ -1000,19 +999,18 @@
         /* We need to initialize it to the BC if it existed */
         /* According to the spec, the CS has to be the same */
         /* If the back ground component is black, then don't bother 
-           with this */
+           with this.  Since we are forcing the rendering to gray
+           earlier now, go ahead and just use the GrayBackGround color 
+           directly. */
         if ( Background_components && GrayBackground != 0.0 ) {
             curr_ptr = buf->data;
-            for (k = 0; k < Background_components; k++) {
-                background_init = (unsigned char) (255.0 * Background[k]);
-	        memset(curr_ptr, background_init, buf->planestride);
-                curr_ptr +=  buf->planestride;
-            }
+            gray = (unsigned char) (255.0 * GrayBackground);
+            memset(curr_ptr, gray, buf->planestride); 
+            curr_ptr +=  buf->planestride;            
             /* If we have a background component that was not black, then we 
                need to set the alpha for this mask as if we had drawn in the
                entire soft mask buffer */
-	    memset(curr_ptr, 255, buf->planestride * 
-                (buf->n_chan - Background_components));
+	    memset(curr_ptr, 255, buf->planestride *(buf->n_chan - 1));
         } else {
             /* Compose mask with opaque background */
 	    memset(buf->data, 0, buf->planestride * buf->n_chan);

Modified: branches/icc_work/base/gstrans.c
===================================================================
--- branches/icc_work/base/gstrans.c	2010-03-19 18:59:38 UTC (rev 10947)
+++ branches/icc_work/base/gstrans.c	2010-03-19 19:24:25 UTC (rev 10948)
@@ -572,6 +572,7 @@
                 blend_color_space->cmm_icc_profile_data->num_comps;
         /* Get the ICC profile */
         params.iccprofile = blend_color_space->cmm_icc_profile_data;
+        params.icc_hash = blend_color_space->cmm_icc_profile_data->hashcode;
         rc_increment(params.iccprofile);
     } else {
         num_components = cs_num_components(blend_color_space);



More information about the gs-commits mailing list