diff options
author | Sebastian Rasmussen <sebras@hotmail.com> | 2010-04-24 17:59:57 +0200 |
---|---|---|
committer | Sebastian Rasmussen <sebras@hotmail.com> | 2010-04-24 17:59:57 +0200 |
commit | f744f965b242130dfdaf7b54bbfd4e9beaa7df36 (patch) | |
tree | e66f6571f88b7447d755dd0e095caa7cfe185dff /apps/pdfinfo.c | |
parent | 69f61eeb42695f960b8a61e62d7dd14219f82f06 (diff) | |
download | mupdf-f744f965b242130dfdaf7b54bbfd4e9beaa7df36.tar.xz |
Always parse info and encryption entries in trailer in pdfinfo.
Diffstat (limited to 'apps/pdfinfo.c')
-rw-r--r-- | apps/pdfinfo.c | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/apps/pdfinfo.c b/apps/pdfinfo.c index d1328549..a9c4392f 100644 --- a/apps/pdfinfo.c +++ b/apps/pdfinfo.c @@ -177,9 +177,10 @@ gatherglobalinfo(void) info->ref = nil; info->u.info.obj = nil; - info->u.info.obj = fz_dictgets(xref->trailer, "Info"); - if (!fz_isindirect(info->u.info.obj)) + info->ref = fz_dictgets(xref->trailer, "Info"); + if (!fz_isindirect(info->ref)) die(fz_throw("not an indirect info object")); + info->u.info.obj = fz_resolveindirect(info->ref); cryptinfo = fz_malloc(sizeof (struct info)); @@ -188,14 +189,11 @@ gatherglobalinfo(void) cryptinfo->ref = nil; cryptinfo->u.crypt.obj = nil; - if (xref->crypt) - { - cryptinfo->ref = fz_dictgets(xref->trailer, "Encrypt"); - if (!fz_isdict(cryptinfo->ref) && !fz_isindirect(cryptinfo->ref)) - die(fz_throw("not an indirect crypt object")); - - // XXX cryptinfo->u.crypt.obj = xref->crypt->encrypt; - } + cryptinfo->ref = fz_dictgets(xref->trailer, "Encrypt"); + if (cryptinfo->ref && + !fz_isdict(cryptinfo->ref) && !fz_isindirect(cryptinfo->ref)) + die(fz_throw("not an indirect crypt object")); + cryptinfo->u.info.obj = fz_resolveindirect(cryptinfo->ref); } static fz_error |