diff options
author | Tor Andersson <tor.andersson@artifex.com> | 2011-04-10 00:11:25 +0200 |
---|---|---|
committer | Tor Andersson <tor.andersson@artifex.com> | 2011-04-10 00:11:25 +0200 |
commit | f6e4a9614978334ca4a8e212bb8b44f34ac94ce2 (patch) | |
tree | c9eccddb8276895aeb312be2744c69cbcc3c5efd /pdf | |
parent | 4a05689ac239535c3441f8d43d21c1373bc0194a (diff) | |
download | mupdf-f6e4a9614978334ca4a8e212bb8b44f34ac94ce2.tar.xz |
Make fz_obj struct opaque.
Diffstat (limited to 'pdf')
-rw-r--r-- | pdf/pdf_crypt.c | 4 | ||||
-rw-r--r-- | pdf/pdf_type3.c | 8 | ||||
-rw-r--r-- | pdf/pdf_xref.c | 5 |
3 files changed, 11 insertions, 6 deletions
diff --git a/pdf/pdf_crypt.c b/pdf/pdf_crypt.c index cdf35d70..d29e756d 100644 --- a/pdf/pdf_crypt.c +++ b/pdf/pdf_crypt.c @@ -638,8 +638,8 @@ pdf_crypt_obj_imp(pdf_crypt *crypt, fz_obj *obj, unsigned char *key, int keylen) memcpy(iv, s, 16); aes_setkey_dec(&aes, key, keylen * 8); aes_crypt_cbc(&aes, AES_DECRYPT, n - 16, iv, s + 16, s); - obj->u.s.len -= 16; /* delete space used for iv */ - obj->u.s.len -= s[n - 17]; /* delete padding bytes at end */ + /* delete space used for iv and padding bytes at end */ + fz_set_str_len(obj, n - 16 - s[n - 17]); } } } diff --git a/pdf/pdf_type3.c b/pdf/pdf_type3.c index ac2c56bc..1d851ebe 100644 --- a/pdf/pdf_type3.c +++ b/pdf/pdf_type3.c @@ -1,6 +1,12 @@ #include "fitz.h" #include "mupdf.h" +static fz_error +pdf_run_glyph_func(void *xref, fz_obj *rdb, fz_buffer *contents, fz_device *dev, fz_matrix ctm) +{ + return pdf_run_glyph(xref, rdb, contents, dev, ctm); +} + fz_error pdf_load_type3_font(pdf_font_desc **fontdescp, pdf_xref *xref, fz_obj *rdb, fz_obj *dict) { @@ -117,7 +123,7 @@ pdf_load_type3_font(pdf_font_desc **fontdescp, pdf_xref *xref, fz_obj *rdb, fz_o fz_warn("no resource dictionary for type 3 font!"); fontdesc->font->t3xref = xref; - fontdesc->font->t3run = pdf_run_glyph; + fontdesc->font->t3run = pdf_run_glyph_func; /* CharProcs */ diff --git a/pdf/pdf_xref.c b/pdf/pdf_xref.c index c5943d64..60b0f2d6 100644 --- a/pdf/pdf_xref.c +++ b/pdf/pdf_xref.c @@ -683,11 +683,10 @@ pdf_debug_xref(pdf_xref *xref) printf("xref\n0 %d\n", xref->len); for (i = 0; i < xref->len; i++) { - printf("%05d: %010d %05d %c (refs=%d, stm_ofs=%d)\n", i, + printf("%05d: %010d %05d %c (stm_ofs=%d)\n", i, xref->table[i].ofs, xref->table[i].gen, xref->table[i].type ? xref->table[i].type : '-', - xref->table[i].obj ? xref->table[i].obj->refs : 0, xref->table[i].stm_ofs); } } @@ -873,7 +872,7 @@ pdf_resolve_indirect(fz_obj *ref) { if (fz_is_indirect(ref)) { - pdf_xref *xref = ref->u.r.xref; + pdf_xref *xref = fz_get_indirect_xref(ref); int num = fz_to_num(ref); int gen = fz_to_gen(ref); if (xref) |