ghostscript/ghostscript-glyph-crash.patch

62 lines
2.9 KiB
Diff

diff -up ghostscript-9.04/psi/zfapi.c.glyph-crash ghostscript-9.04/psi/zfapi.c
--- ghostscript-9.04/psi/zfapi.c.glyph-crash 2011-08-05 12:12:20.000000000 +0100
+++ ghostscript-9.04/psi/zfapi.c 2011-11-01 13:24:54.334696191 +0000
@@ -1885,34 +1885,35 @@ static int fapi_finish_render_aux(i_ctx_
/* The server provides an outline instead the raster. */
gs_imager_state *pis = (gs_imager_state *)pgs->show_gstate;
gs_point pt;
+ if (!I->skip_glyph) {
+ if ((code = gs_currentpoint(pgs, &pt)) < 0)
+ return code;
+ if ((code = outline_char(i_ctx_p, I, import_shift_v, penum_s, pgs->path, !pbfont->PaintType)) < 0)
+ return code;
+ if ((code = gs_imager_setflat((gs_imager_state *)pgs, gs_char_flatness(pis, 1.0))) < 0)
+ return code;
+ if (pbfont->PaintType) {
+ float lw = gs_currentlinewidth(pgs);
- if ((code = gs_currentpoint(pgs, &pt)) < 0)
- return code;
- if ((code = outline_char(i_ctx_p, I, import_shift_v, penum_s, pgs->path, !pbfont->PaintType)) < 0)
- return code;
- if ((code = gs_imager_setflat((gs_imager_state *)pgs, gs_char_flatness(pis, 1.0))) < 0)
- return code;
- if (pbfont->PaintType) {
- float lw = gs_currentlinewidth(pgs);
+ gs_setlinewidth(pgs, pbfont->StrokeWidth);
+ code = gs_stroke(pgs);
+ gs_setlinewidth(pgs, lw);
+ if (code < 0)
+ return code;
+ } else {
+ gs_in_cache_device_t in_cachedevice = pgs->in_cachedevice;
+ pgs->in_cachedevice = CACHE_DEVICE_NOT_CACHING;
- gs_setlinewidth(pgs, pbfont->StrokeWidth);
- code = gs_stroke(pgs);
- gs_setlinewidth(pgs, lw);
- if (code < 0)
- return code;
- } else {
- gs_in_cache_device_t in_cachedevice = pgs->in_cachedevice;
- pgs->in_cachedevice = CACHE_DEVICE_NOT_CACHING;
+ pgs->fill_adjust.x = pgs->fill_adjust.y = 0;
- pgs->fill_adjust.x = pgs->fill_adjust.y = 0;
+ if ((code = gs_fill(pgs)) < 0)
+ return code;
- if ((code = gs_fill(pgs)) < 0)
+ pgs->in_cachedevice = in_cachedevice;
+ }
+ if ((code = gs_moveto(pgs, pt.x, pt.y)) < 0)
return code;
-
- pgs->in_cachedevice = in_cachedevice;
}
- if ((code = gs_moveto(pgs, pt.x, pt.y)) < 0)
- return code;
} else {
int rast_orig_x = rast.orig_x;
int rast_orig_y = - rast.orig_y;