summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTor Andersson <tor@ghostscript.com>2010-06-23 11:54:28 +0200
committerTor Andersson <tor@ghostscript.com>2010-06-23 11:54:28 +0200
commit08b3025f9355e53157fadc803fd942debc86d5a2 (patch)
tree15d46174b173567e1b1e91b67b37238108180eb3
parent09b0921fc59c7b48b1e0c0b9955d183a19ab4a4c (diff)
downloadmupdf-08b3025f9355e53157fadc803fd942debc86d5a2.tar.xz
Improve error case cleanup in pdf_font.
-rw-r--r--mupdf/pdf_font.c8
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));
}