diff options
Diffstat (limited to 'source/pdf/pdf-interpret.c')
-rw-r--r-- | source/pdf/pdf-interpret.c | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/source/pdf/pdf-interpret.c b/source/pdf/pdf-interpret.c index 515a87fa..62173cf8 100644 --- a/source/pdf/pdf-interpret.c +++ b/source/pdf/pdf-interpret.c @@ -1059,16 +1059,15 @@ static void pdf_copy_pattern_gstate(fz_context *ctx, pdf_gstate *gs, const pdf_gstate *old) { gs->ctm = old->ctm; - gs->font = old->font; - gs->softmask = old->softmask; + + pdf_drop_font(ctx, gs->font); + gs->font = pdf_keep_font(ctx, old->font); + + pdf_drop_xobject(ctx, gs->softmask); + gs->softmask = pdf_keep_xobject(ctx, old->softmask); fz_drop_stroke_state(ctx, gs->stroke_state); gs->stroke_state = fz_keep_stroke_state(ctx, old->stroke_state); - - if (gs->font) - pdf_keep_font(ctx, gs->font); - if (gs->softmask) - pdf_keep_xobject(ctx, gs->softmask); } static pdf_csi * |