summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRay Johnston <ray.johnston@artifex.com>2005-04-13 20:04:46 +0000
committerRay Johnston <ray.johnston@artifex.com>2005-04-13 20:04:46 +0000
commit4ccc3953172acc6bbf810d41f1494d798d53d27c (patch)
treec98a491bf41ccb9af697834344f466b7e518e27d
parente13af18e267d6f4004838f66eaaf6e99284cfcbb (diff)
downloadghostpdl-4ccc3953172acc6bbf810d41f1494d798d53d27c.tar.gz
Fix a SEGV when ImageType 4 has MaskColor values outside the range.
Detected with the PDF file from bug 687611 for customer 870. DETAILS: The rangecheck error was being thrown with the gx_image_enum allocated but with many pointers not initialized so the SEGV happened when the garbage collector tried to enumerate the image_enum. The fix is simple and low-risk -- free the penum before returning the rangecheck error. git-svn-id: http://svn.ghostscript.com/ghostscript/trunk@5842 a1074d23-0009-0410-80fe-cf8c14f379e6
-rw-r--r--gs/src/gximage4.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/gs/src/gximage4.c b/gs/src/gximage4.c
index cbcd84fc6..6d896e29f 100644
--- a/gs/src/gximage4.c
+++ b/gs/src/gximage4.c
@@ -90,8 +90,10 @@ gx_begin_image4(gx_device * dev,
else
c0 = c1 = pim->MaskColor[i >> 1];
- if ((c0 | c1) > max_value)
+ if ((c0 | c1) > max_value) {
+ gs_free_object(mem, penum, "gx_begin_image4");
return_error(gs_error_rangecheck);
+ }
if (c0 > c1) {
opaque = true; /* pixel can never match mask color */
break;