summaryrefslogtreecommitdiff
path: root/draw
diff options
context:
space:
mode:
authorTor Andersson <tor@ghostscript.com>2010-06-20 21:56:08 +0200
committerTor Andersson <tor@ghostscript.com>2010-06-20 21:56:08 +0200
commitb282908b5e1660cd44db89ddbe5ab9af03185295 (patch)
tree39b2e555358f1f433a1c957981122b1479a7bc32 /draw
parent194ac682d758ef26a9958ef39c851974808f33d9 (diff)
downloadmupdf-b282908b5e1660cd44db89ddbe5ab9af03185295.tar.xz
Move font size check from interpreter to font rendering.
Diffstat (limited to 'draw')
-rw-r--r--draw/glyphcache.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/draw/glyphcache.c b/draw/glyphcache.c
index ac148340..0f8abf75 100644
--- a/draw/glyphcache.c
+++ b/draw/glyphcache.c
@@ -1,5 +1,6 @@
#include "fitz.h"
+#define MAXFONTSIZE 1000
#define MAXGLYPHSIZE 256
#define MAXCACHESIZE (1024*1024)
@@ -67,6 +68,14 @@ fz_renderglyph(fz_glyphcache *cache, fz_font *font, int cid, fz_matrix ctm)
{
fz_glyphkey key;
fz_pixmap *val;
+ float size = fz_matrixexpansion(ctm);
+
+ if (size > MAXFONTSIZE)
+ {
+ /* TODO: this case should be handled by rendering glyph as a path fill */
+ fz_warn("font size too large (%g), not rendering glyph", size);
+ return nil;
+ }
key.font = font;
key.cid = cid;