diff options
author | Robin Watts <robin.watts@artifex.com> | 2011-12-23 11:20:16 +0000 |
---|---|---|
committer | Robin Watts <robin.watts@artifex.com> | 2011-12-23 11:20:16 +0000 |
commit | cc4dd0f8358d3de1594cc530b8f2691bccf194f0 (patch) | |
tree | d1bb840ff369382d6a89553ceb3b23464c806af3 /pdf/pdf_type3.c | |
parent | 3145e49a9ce16d45bf4d6bb01c64646f41d70e8f (diff) | |
download | mupdf-cc4dd0f8358d3de1594cc530b8f2691bccf194f0.tar.xz |
Add some fz_vars to fix exception behaviour.
gcc 4.4.5 gives helpful warnings about variables that can become
unset due to setjmp/longjmp usage. Fix that here.
Thanks to Sebras.
Diffstat (limited to 'pdf/pdf_type3.c')
-rw-r--r-- | pdf/pdf_type3.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/pdf/pdf_type3.c b/pdf/pdf_type3.c index c63a2642..730a2754 100644 --- a/pdf/pdf_type3.c +++ b/pdf/pdf_type3.c @@ -12,7 +12,7 @@ pdf_load_type3_font(pdf_xref *xref, fz_obj *rdb, fz_obj *dict) { char buf[256]; char *estrings[256]; - pdf_font_desc *fontdesc; + pdf_font_desc *fontdesc = NULL; fz_obj *encoding; fz_obj *widths; fz_obj *charprocs; @@ -23,6 +23,8 @@ pdf_load_type3_font(pdf_xref *xref, fz_obj *rdb, fz_obj *dict) fz_matrix matrix; fz_context *ctx = xref->ctx; + fz_var(fontdesc); + fz_try(ctx) { obj = fz_dict_gets(dict, "Name"); @@ -148,7 +150,8 @@ pdf_load_type3_font(pdf_xref *xref, fz_obj *rdb, fz_obj *dict) } fz_catch(ctx) { - fz_drop_font(ctx, fontdesc->font); + if (fontdesc) + fz_drop_font(ctx, fontdesc->font); fz_free(ctx, fontdesc); fz_throw(ctx, "cannot load type3 font (%d %d R)", fz_to_num(dict), fz_to_gen(dict)); } |