diff options
author | Tor Andersson <tor.andersson@artifex.com> | 2014-05-19 13:36:45 +0200 |
---|---|---|
committer | Tor Andersson <tor.andersson@artifex.com> | 2014-05-19 13:39:48 +0200 |
commit | 5faaa444cb08a19eb9eb932010bb70cb3e3423f4 (patch) | |
tree | c696003122666aca3d2bb2b8aeabb96b501aadae /source/fitz | |
parent | bb66f6335fce7cacf83fa6289eb3b433c4e29b6a (diff) | |
download | mupdf-5faaa444cb08a19eb9eb932010bb70cb3e3423f4.tar.xz |
Fix 694952: Limit Type 3 font glyph bbox size.
Don't let a glyph's bbox be too much bigger than the font bbox.
Diffstat (limited to 'source/fitz')
-rw-r--r-- | source/fitz/font.c | 6 |
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; } |