diff options
author | Tor Andersson <tor@ghostscript.com> | 2011-02-02 15:35:42 +0000 |
---|---|---|
committer | Tor Andersson <tor@ghostscript.com> | 2011-02-02 15:35:42 +0000 |
commit | 333860c5c9c4539f36d3bd0716bc696a6ebddd0f (patch) | |
tree | 737e1680ae5f0b07ca5855708ae3b86fbf33b2c7 /fitz | |
parent | 2bf4f68dbdad42e2640baaab8e9217cdadb85a04 (diff) | |
download | mupdf-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')
-rw-r--r-- | fitz/fitz.h | 1 | ||||
-rw-r--r-- | fitz/res_font.c | 4 |
2 files changed, 5 insertions, 0 deletions
diff --git a/fitz/fitz.h b/fitz/fitz.h index fcedbebe..b7787acc 100644 --- a/fitz/fitz.h +++ b/fitz/fitz.h @@ -661,6 +661,7 @@ struct fz_font_s void *ftface; /* has an FT_Face if used */ int ftsubstitute; /* ... substitute metrics */ int fthint; /* ... force hinting for DynaLab fonts */ + unsigned char *ftdata; fz_matrix t3matrix; fz_obj *t3resources; 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); |