diff options
author | Robin Watts <robin.watts@artifex.com> | 2012-11-29 11:55:34 +0000 |
---|---|---|
committer | Robin Watts <robin.watts@artifex.com> | 2012-11-29 11:57:11 +0000 |
commit | c3fa0d45ff96eefe6effaeffc45516c6f85587bd (patch) | |
tree | 5f6b8682571b9a76ffde02895ce1b7fc109d9c95 /pdf/pdf_xobject.c | |
parent | 94b2a364223143dc7f749862c6983173d8b47a66 (diff) | |
download | mupdf-c3fa0d45ff96eefe6effaeffc45516c6f85587bd.tar.xz |
Bug 693463: Fix various memory leaks.
All these leaks were spotted by zeniko, so credit/thanks to him.
Diffstat (limited to 'pdf/pdf_xobject.c')
-rw-r--r-- | pdf/pdf_xobject.c | 62 |
1 files changed, 31 insertions, 31 deletions
diff --git a/pdf/pdf_xobject.c b/pdf/pdf_xobject.c index 4d7243b6..86b45167 100644 --- a/pdf/pdf_xobject.c +++ b/pdf/pdf_xobject.c @@ -57,46 +57,46 @@ pdf_load_xobject(pdf_document *xref, pdf_obj *dict) /* Store item immediately, to avoid possible recursion if objects refer back to this one */ pdf_store_item(ctx, dict, form, pdf_xobject_size(form)); - obj = pdf_dict_gets(dict, "BBox"); - form->bbox = pdf_to_rect(ctx, obj); - - obj = pdf_dict_gets(dict, "Matrix"); - if (obj) - form->matrix = pdf_to_matrix(ctx, obj); - else - form->matrix = fz_identity; - - form->isolated = 0; - form->knockout = 0; - form->transparency = 0; - - obj = pdf_dict_gets(dict, "Group"); - if (obj) + fz_try(ctx) { - pdf_obj *attrs = obj; + obj = pdf_dict_gets(dict, "BBox"); + form->bbox = pdf_to_rect(ctx, obj); - form->isolated = pdf_to_bool(pdf_dict_gets(attrs, "I")); - form->knockout = pdf_to_bool(pdf_dict_gets(attrs, "K")); + obj = pdf_dict_gets(dict, "Matrix"); + if (obj) + form->matrix = pdf_to_matrix(ctx, obj); + else + form->matrix = fz_identity; - obj = pdf_dict_gets(attrs, "S"); - if (pdf_is_name(obj) && !strcmp(pdf_to_name(obj), "Transparency")) - form->transparency = 1; + form->isolated = 0; + form->knockout = 0; + form->transparency = 0; - obj = pdf_dict_gets(attrs, "CS"); + obj = pdf_dict_gets(dict, "Group"); if (obj) { - form->colorspace = pdf_load_colorspace(xref, obj); - if (!form->colorspace) - fz_throw(ctx, "cannot load xobject colorspace"); + pdf_obj *attrs = obj; + + form->isolated = pdf_to_bool(pdf_dict_gets(attrs, "I")); + form->knockout = pdf_to_bool(pdf_dict_gets(attrs, "K")); + + obj = pdf_dict_gets(attrs, "S"); + if (pdf_is_name(obj) && !strcmp(pdf_to_name(obj), "Transparency")) + form->transparency = 1; + + obj = pdf_dict_gets(attrs, "CS"); + if (obj) + { + form->colorspace = pdf_load_colorspace(xref, obj); + if (!form->colorspace) + fz_throw(ctx, "cannot load xobject colorspace"); + } } - } - form->resources = pdf_dict_gets(dict, "Resources"); - if (form->resources) - pdf_keep_obj(form->resources); + form->resources = pdf_dict_gets(dict, "Resources"); + if (form->resources) + pdf_keep_obj(form->resources); - fz_try(ctx) - { form->contents = pdf_keep_obj(dict); } fz_catch(ctx) |