diff options
author | Tor Andersson <tor@ghostscript.com> | 2010-06-23 11:54:28 +0200 |
---|---|---|
committer | Tor Andersson <tor@ghostscript.com> | 2010-06-23 11:54:28 +0200 |
commit | 08b3025f9355e53157fadc803fd942debc86d5a2 (patch) | |
tree | 15d46174b173567e1b1e91b67b37238108180eb3 | |
parent | 09b0921fc59c7b48b1e0c0b9955d183a19ab4a4c (diff) | |
download | mupdf-08b3025f9355e53157fadc803fd942debc86d5a2.tar.xz |
Improve error case cleanup in pdf_font.
-rw-r--r-- | mupdf/pdf_font.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/mupdf/pdf_font.c b/mupdf/pdf_font.c index 221ff396..f396bc59 100644 --- a/mupdf/pdf_font.c +++ b/mupdf/pdf_font.c @@ -522,10 +522,9 @@ loadsimplefont(pdf_fontdesc **fontdescp, pdf_xref *xref, fz_obj *dict) return fz_okay; cleanup: - if (etable) + if (etable != fontdesc->cidtogid) fz_free(etable); - fz_dropfont(fontdesc->font); - fz_free(fontdesc); + pdf_dropfont(fontdesc); return fz_rethrow(error, "cannot load simple font (%d %d R)", fz_tonum(dict), fz_togen(dict)); } @@ -804,8 +803,7 @@ loadcidfont(pdf_fontdesc **fontdescp, pdf_xref *xref, fz_obj *dict, fz_obj *enco return fz_okay; cleanup: - fz_dropfont(fontdesc->font); - fz_free(fontdesc); + pdf_dropfont(fontdesc); return fz_rethrow(error, "cannot load cid font (%d %d R)", fz_tonum(dict), fz_togen(dict)); } |