diff options
author | Tor Andersson <tor.andersson@artifex.com> | 2016-07-12 13:04:10 +0200 |
---|---|---|
committer | Tor Andersson <tor.andersson@artifex.com> | 2016-07-12 14:45:46 +0200 |
commit | 8abdcfd3c1cc410d705cb7df07bdfc9203af99ac (patch) | |
tree | b74e230904df510633e8e5cee417adffe7ad0ffc | |
parent | fdda43df9ee7883205fedf46a40e324e98b42e1e (diff) | |
download | mupdf-8abdcfd3c1cc410d705cb7df07bdfc9203af99ac.tar.xz |
xps: Only recognize <dir>/_rels/.rels type paths, not any .rels file.
-rw-r--r-- | source/xps/xps-doc.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/source/xps/xps-doc.c b/source/xps/xps-doc.c index fb4511f4..b796b922 100644 --- a/source/xps/xps-doc.c +++ b/source/xps/xps-doc.c @@ -470,15 +470,16 @@ xps_recognize(fz_context *ctx, const char *magic) if (ext) { - if (!fz_strcasecmp(ext, ".xps") || !fz_strcasecmp(ext, ".rels") || !fz_strcasecmp(ext, ".oxps")) + if (!fz_strcasecmp(ext, ".xps") || !fz_strcasecmp(ext, ".oxps")) return 100; } + if (strstr(magic, "/_rels/.rels") || strstr(magic, "\\_rels\\.rels")) + return 100; if (!strcmp(magic, "xps") || !strcmp(magic, "oxps") || !strcmp(magic, "application/vnd.ms-xpsdocument") || !strcmp(magic, "application/xps") || !strcmp(magic, "application/oxps")) return 100; - return 0; } |