summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--source/fitz/font.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/source/fitz/font.c b/source/fitz/font.c
index 4e676361..598931e8 100644
--- a/source/fitz/font.c
+++ b/source/fitz/font.c
@@ -1074,6 +1074,7 @@ fz_bound_t3_glyph(fz_context *ctx, fz_font *font, int gid, const fz_matrix *trm,
fz_display_list *list;
fz_matrix ctm;
fz_device *dev;
+ fz_rect big;
list = font->t3lists[gid];
if (!list)
@@ -1097,6 +1098,11 @@ fz_bound_t3_glyph(fz_context *ctx, fz_font *font, int gid, const fz_matrix *trm,
fz_rethrow(ctx);
}
+ /* clip the bbox size to a reasonable maximum for degenerate glyphs */
+ big = font->bbox;
+ fz_expand_rect(&big, fz_max(fz_matrix_expansion(&ctm) * 2, fz_max(big.x1 - big.x0, big.y1 - big.y0)));
+ fz_intersect_rect(bounds, &big);
+
return bounds;
}