Fix for 687101, Crash in GC on some PDF files

Alex Cherepanov <[email protected]>
Newsgroups gmane.comp.printing.ghostscript.patches
Organization Coscript Software
Message-ID <[email protected]>
Restore the invariant: effective_transfer always points to the transfer
functions in the graphic state or halftone. Old code briefly leaved 
effective_transfer pointing to garbage, which caused relocation of 
garbage pointers and crash if GC happened at the right time.

_______________________________________________
gs-code-review mailing list
[email protected]
http://www.ghostscript.com/mailman/listinfo/gs-code-review
gscolor.c.diff (text/plain, 1.1 KB)
Index: gs/src/gscolor.c
===================================================================
RCS file: /cvs/ghostscript/gs/src/gscolor.c,v
retrieving revision 1.11
diff -b -u -r1.11 gscolor.c
--- gs/src/gscolor.c	18 Aug 2003 21:21:57 -0000	1.11
+++ gs/src/gscolor.c	7 Nov 2003 03:17:55 -0000
@@ -185,7 +185,8 @@
 	load_transfer_map(pgs, ptran->gray, 0.0);
 	gx_set_effective_transfer(pgs);
 	gx_unset_dev_color(pgs);
-    }
+    } else
+	gx_set_effective_transfer(pgs);
     return 0;
   fail:
     rc_increment(ptran->red);
Index: gs/src/gscolor1.c
===================================================================
RCS file: /cvs/ghostscript/gs/src/gscolor1.c,v
retrieving revision 1.8
diff -b -u -r1.8 gscolor1.c
--- gs/src/gscolor1.c	22 Aug 2002 07:12:28 -0000	1.8
+++ gs/src/gscolor1.c	7 Nov 2003 03:17:55 -0000
@@ -168,7 +168,8 @@
 	load_transfer_map(pgs, ptran->gray, 0.0);
 	gx_set_effective_transfer(pgs);
 	gx_unset_dev_color(pgs);
-    }
+    } else
+	gx_set_effective_transfer(pgs);
     return 0;
   fblue:
     rc_assign(ptran->green, old.green, "setcolortransfer");
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.