[gs-cvs] gs/src

Raph Levien raph at casper.ghostscript.com
Mon Mar 4 14:20:37 PST 2002


Update of /cvs/ghostscript/gs/src
In directory casper:/tmp/cvs-serv11555/src

Modified Files:
	zshade.c 
Log Message:
Fix: Triggers an /undefined error rather than segfaulting in the case
where a directional shading dictionary is missing a Function element.
build_shading_function() returns a success code in these cases because
functions are optional in some shading types. Thanks to Alex Cherepanov
for the analysis and patch.


Index: zshade.c
===================================================================
RCS file: /cvs/ghostscript/gs/src/zshade.c,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -d -r1.7 -r1.8
--- zshade.c	21 Feb 2002 22:24:54 -0000	1.7
+++ zshade.c	4 Mar 2002 22:20:34 -0000	1.8
@@ -316,6 +316,8 @@
 	(code = build_shading_function(i_ctx_p, op, pFunction, 1, mem)) < 0
 	)
 	return code;
+    if (!*pFunction)
+	    return_error(e_undefined);
     if (dict_find_string(op, "Extend", &pExtend) <= 0)
 	Extend[0] = Extend[1] = false;
     else {




More information about the gs-cvs mailing list