[gs-cvs] rev 6898 - trunk/gs/src
stefan at ghostscript.com
stefan at ghostscript.com
Thu Jul 6 10:12:15 PDT 2006
Author: stefan
Date: 2006-07-06 10:12:15 -0700 (Thu, 06 Jul 2006)
New Revision: 6898
Modified:
trunk/gs/src/gxccman.c
Log:
Fix null ptr dereference committed on rev 6866
DETAILS:
In the case where gx_alloc_char_bits is called with a null
device pointer the default of 72 dpi is used.
EXPECTED DIFFERENCES:
None.
Modified: trunk/gs/src/gxccman.c
===================================================================
--- trunk/gs/src/gxccman.c 2006-07-06 11:10:42 UTC (rev 6897)
+++ trunk/gs/src/gxccman.c 2006-07-06 17:12:15 UTC (rev 6898)
@@ -496,14 +496,18 @@
cached_char *cc;
gx_device_memory mdev;
gx_device_memory *pdev = dev;
- gx_device_memory *pdev2;
- float HWResolution0 = dev->HWResolution[0], HWResolution1 = dev->HWResolution[1];
-
+ gx_device_memory *pdev2;
+ float HWResolution0 = 72, HWResolution1 = 72; /* default for dev == NULL */
+
if (dev == NULL) {
mdev.memory = 0;
mdev.target = 0;
pdev = &mdev;
+ } else {
+ HWResolution0 = dev->HWResolution[0];
+ HWResolution1 = dev->HWResolution[1];
}
+
pdev2 = (dev2 == 0 ? pdev : dev2);
/* Compute the scaled-down bitmap size, and test against */
More information about the gs-cvs
mailing list