summaryrefslogtreecommitdiff
path: root/fitz/res_font.c
diff options
context:
space:
mode:
authorTor Andersson <tor@ghostscript.com>2011-02-02 15:35:42 +0000
committerTor Andersson <tor@ghostscript.com>2011-02-02 15:35:42 +0000
commit333860c5c9c4539f36d3bd0716bc696a6ebddd0f (patch)
tree737e1680ae5f0b07ca5855708ae3b86fbf33b2c7 /fitz/res_font.c
parent2bf4f68dbdad42e2640baaab8e9217cdadb85a04 (diff)
downloadmupdf-333860c5c9c4539f36d3bd0716bc696a6ebddd0f.tar.xz
Store font data buffer in fz_font rather than in pdf_fontdesc. Fixes bug where the fontdesc was evicted from cache while the font still lived on in a display list, with a now stale pointer.
Diffstat (limited to 'fitz/res_font.c')
-rw-r--r--fitz/res_font.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/fitz/res_font.c b/fitz/res_font.c
index cfbb08bf..2fddcf2a 100644
--- a/fitz/res_font.c
+++ b/fitz/res_font.c
@@ -18,6 +18,7 @@ fz_newfont(void)
font->ftface = nil;
font->ftsubstitute = 0;
font->fthint = 0;
+ font->ftdata = nil;
font->t3matrix = fz_identity;
font->t3resources = nil;
@@ -71,6 +72,9 @@ fz_dropfont(fz_font *font)
fz_finalizefreetype();
}
+ if (font->ftdata)
+ fz_free(font->ftdata);
+
if (font->widthtable)
fz_free(font->widthtable);