[Gs-code-review] A fix for #516530 heap crash with OTGuide.pdf .

Igor V. Melichev igor at artifex.com
Wed Feb 13 22:22:22 PST 2002


[Log message beg]
Fix: gx_begin_image3x_generic passed uninitialized data to
gs_cspace_init_DevicePixel,
when ShapeMaskDict is absent, causing a crash of garbager.
Source Forge bug #516530 heap crash with OTGuide.pdf .
[Log message end]

Branches : HEAD.

Please pay attention to the hack explained in the comment.
I'm not sure how to fix it completely.
Without the hack it crashes with OTGuide.pdf in another place.

Changes:


File gximag3x.c :

*** f:\CVSroot\head\gs\src\gximag3x.c	Tue Sep 19 23:00:37 2000
--- files\gs\src\gximag3x.c	Thu Feb 14 09:11:55 2002
***************
*** 160,163 ****
--- 160,164 ----
      penum->mask[0].info = 0, penum->mask[0].mdev = 0, penum->mask[0].data
= 0;
      penum->mask[1].info = 0, penum->mask[1].mdev = 0, penum->mask[1].data
= 0;
+     penum->mask[0].depth = penum->mask[1].depth = 0;
      penum->pixel.info = 0, penum->pixel.data = 0;
      if (prect)
***************
*** 264,273 ****
  	    m_mat.ty -= origin[i].y;
  	    /*
! 	     * Note that pis = NULL here, since we don't want to have to
  	     * create another imager state with default log_op, etc.
  	     * dcolor = NULL is OK because this is an opaque image with
  	     * CombineWithColor = false.
  	     */
! 	    code = gx_device_begin_typed_image(mdev, NULL, &m_mat,
  			       (const gs_image_common_t *)&mask[i].image,
  					       &mask[i].rect, NULL, NULL,
--- 265,276 ----
  	    m_mat.ty -= origin[i].y;
  	    /*
! 	     * Hack: we pass pis here, rather we need to
  	     * create another imager state with default log_op, etc.
+              */
+             /*
  	     * dcolor = NULL is OK because this is an opaque image with
  	     * CombineWithColor = false.
  	     */
! 	    code = gx_device_begin_typed_image(mdev, pis, &m_mat,
  			       (const gs_image_common_t *)&mask[i].image,
  					       &mask[i].rect, NULL, NULL,





More information about the gs-code-review mailing list