summaryrefslogtreecommitdiff
path: root/pdf/pdf_type3.c
diff options
context:
space:
mode:
authorRobin Watts <robin.watts@artifex.com>2011-12-23 11:20:16 +0000
committerRobin Watts <robin.watts@artifex.com>2011-12-23 11:20:16 +0000
commitcc4dd0f8358d3de1594cc530b8f2691bccf194f0 (patch)
treed1bb840ff369382d6a89553ceb3b23464c806af3 /pdf/pdf_type3.c
parent3145e49a9ce16d45bf4d6bb01c64646f41d70e8f (diff)
downloadmupdf-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.c7
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));
}