diff options
author | Tor Andersson <tor.andersson@artifex.com> | 2011-09-21 00:11:22 +0200 |
---|---|---|
committer | Tor Andersson <tor.andersson@artifex.com> | 2011-09-21 00:11:22 +0200 |
commit | 69ed4a8f4dbfac7f2f1de925e34807e4fee3b27c (patch) | |
tree | b7f82296a259d360ce90f0826e475321d630a222 /apps/pdfextract.c | |
parent | 99ba154018b7c4a2c47b4c7e721ffe6d9164f9f3 (diff) | |
download | mupdf-69ed4a8f4dbfac7f2f1de925e34807e4fee3b27c.tar.xz |
Don't thread ctx through safe fz_obj functions.
Diffstat (limited to 'apps/pdfextract.c')
-rw-r--r-- | apps/pdfextract.c | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/apps/pdfextract.c b/apps/pdfextract.c index 96ea7e87..490a8c1e 100644 --- a/apps/pdfextract.c +++ b/apps/pdfextract.c @@ -27,14 +27,14 @@ static void usage(void) static int isimage(fz_obj *obj) { - fz_obj *type = fz_dict_gets(ctx, obj, "Subtype"); - return fz_is_name(ctx, type) && !strcmp(fz_to_name(ctx, type), "Image"); + fz_obj *type = fz_dict_gets(obj, "Subtype"); + return fz_is_name(type) && !strcmp(fz_to_name(type), "Image"); } static int isfontdesc(fz_obj *obj) { - fz_obj *type = fz_dict_gets(ctx, obj, "Type"); - return fz_is_name(ctx, type) && !strcmp(fz_to_name(ctx, type), "FontDescriptor"); + fz_obj *type = fz_dict_gets(obj, "Type"); + return fz_is_name(type) && !strcmp(fz_to_name(type), "FontDescriptor"); } static void saveimage(int num) @@ -75,7 +75,7 @@ static void saveimage(int num) } fz_drop_pixmap(ctx, img); - fz_drop_obj(ctx, ref); + fz_drop_obj(ref); } static void savefont(fz_obj *dict, int num) @@ -91,34 +91,34 @@ static void savefont(fz_obj *dict, int num) char *fontname = "font"; int n; - obj = fz_dict_gets(ctx, dict, "FontName"); + obj = fz_dict_gets(dict, "FontName"); if (obj) - fontname = fz_to_name(ctx, obj); + fontname = fz_to_name(obj); - obj = fz_dict_gets(ctx, dict, "FontFile"); + obj = fz_dict_gets(dict, "FontFile"); if (obj) { stream = obj; ext = "pfa"; } - obj = fz_dict_gets(ctx, dict, "FontFile2"); + obj = fz_dict_gets(dict, "FontFile2"); if (obj) { stream = obj; ext = "ttf"; } - obj = fz_dict_gets(ctx, dict, "FontFile3"); + obj = fz_dict_gets(dict, "FontFile3"); if (obj) { stream = obj; - obj = fz_dict_gets(ctx, obj, "Subtype"); - if (obj && !fz_is_name(ctx, obj)) + obj = fz_dict_gets(obj, "Subtype"); + if (obj && !fz_is_name(obj)) die(fz_error_make("Invalid font descriptor subtype")); - subtype = fz_to_name(ctx, obj); + subtype = fz_to_name(obj); if (!strcmp(subtype, "Type1C")) ext = "cff"; else if (!strcmp(subtype, "CIDFontType0C")) @@ -173,7 +173,7 @@ static void showobject(int num) else if (isfontdesc(obj)) savefont(obj, num); - fz_drop_obj(ctx, obj); + fz_drop_obj(obj); } int main(int argc, char **argv) |