Article View: gnu.ghostscript.bug
Article #237Memory leak - image[mask]
From: L. Peter Deutsch
Date: Wed, 16 Aug 1989 07:32
Date: Wed, 16 Aug 1989 07:32
36 lines
1727 bytes
1727 bytes
A bug has been discovered in the image and imagemask operators that
causes at least 516 bytes of memory to be permanently lost each time
one of these operators is invoked. This causes major problems for
dvi2ps output, which uses bitmap (image) fonts.
The bug will, of course, be fixed in the imminent 1.4 release.
Meanwhile, here is the patch to the image_continue procedure in
zpaint.c:
/* Continuation procedure. Hand the string to the enumerator. */
private int
image_continue(register ref *op)
{ gs_image_enum *penum = (gs_image_enum *)esp->value.bytes;
int code;
if ( r_type(op) != t_string )
{ /* Procedure didn't return a string. Quit. */
esp -= inumpush;
alloc_free((char *)penum, gs_image_enum_sizeof,
"image_continue(quit)");
return e_typecheck;
}
code = gs_image_next(penum, op->value.bytes, op->size);
if ( op->size == 0 || code > 0 ) /* stop now */
{ esp -= inumpush;
alloc_free((char *)penum, gs_image_enum_sizeof,
"image_continue(finished)");
}
<<< rest of procedure is unchanged >>>
This bug has been present in every version of Ghostscript, but
apparently no one was running dvi2ps output through Ghostscript until
recently.
L. Peter Deutsch ghost@aladdin.com
Aladdin Enterprises ...{uunet,parcplace}!aladdin!ghost
P. O. box 60264, Palo Alto, CA 94306
Technical Details
Message-ID:
<8908160032.0.UUL1.3#5127@aladdin.com>Path:
arc1-ca.pugleaf.net!utzoo!utgpu!watmath!uunet!tut.cis.ohio-state.edu!aladdin.com!ghostShow Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!watmath!uunet!tut.cis.ohio-state.edu!aladdin.com!ghost From: ghost@aladdin.com (L. Peter Deutsch) Newsgroups: gnu.ghostscript.bug Subject: Memory leak - image[mask] Message-ID: <8908160032.0.UUL1.3#5127@aladdin.com> Date: 16 Aug 89 07:32:47 GMT Sender: daemon@tut.cis.ohio-state.edu Distribution: gnu Organization: GNUs Not Usenet Lines: 36