diff options
author | Sebastian Rasmussen <sebras@hotmail.com> | 2009-02-28 18:20:17 +0100 |
---|---|---|
committer | Sebastian Rasmussen <sebras@hotmail.com> | 2009-02-28 18:20:17 +0100 |
commit | 57348a2f285c0d4620c530077d884a0b09d0a330 (patch) | |
tree | fd0f9406d5f50bd72614a829dba0bd812a574f4f | |
parent | d5eae2e37435e6120907e16ea5f60f5691781877 (diff) | |
download | mupdf-57348a2f285c0d4620c530077d884a0b09d0a330.tar.xz |
Properly handle alternate colorspaces.
-rw-r--r-- | apps/pdftool.c | 25 |
1 files changed, 18 insertions, 7 deletions
diff --git a/apps/pdftool.c b/apps/pdftool.c index b6ccf21d..ee7d3d2b 100644 --- a/apps/pdftool.c +++ b/apps/pdftool.c @@ -1221,13 +1221,24 @@ gatherimages(int page, fz_obj *pageref, fz_obj *pageobj, fz_obj *dict) if (fz_isname(cs) && (!strcmp(fz_toname(cs), "DeviceN") || !strcmp(fz_toname(cs), "Separation"))) { - altcs = fz_arrayget(cses, 2); - if (altcs) - { - error = pdf_resolve(&altcs, src); - if (error) - return fz_rethrow(error, "cannot resolve indirect image alternate colorspace name (%d %d R)", fz_tonum(ref), fz_togen(ref)); - } + altcs = fz_arrayget(cses, 2); + if (altcs) + { + error = pdf_resolve(&altcs, src); + if (error) + return fz_rethrow(error, "cannot resolve indirect image alternate colorspace name (%d %d R)", fz_tonum(ref), fz_togen(ref)); + } + + if (fz_isarray(altcs)) + { + altcs = fz_arrayget(altcs, 0); + if (altcs) + { + error = pdf_resolve(&altcs, src); + if (error) + return fz_rethrow(error, "cannot resolve indirect image alternate colorspace name (%d %d R)", fz_tonum(ref), fz_togen(ref)); + } + } } } |