diff options
author | Tor Andersson <tor.andersson@artifex.com> | 2012-11-27 01:18:08 +0100 |
---|---|---|
committer | Robin Watts <robin.watts@artifex.com> | 2012-11-27 12:28:59 +0000 |
commit | 84a407353a4ce841d5400768c93affe281c7fd69 (patch) | |
tree | dd693b9864a3671447d6edac9b302582c090d653 /fitz/base_xml.c | |
parent | c127107f51cf3082c070d1e45af8f99eafaf5e5f (diff) | |
download | mupdf-84a407353a4ce841d5400768c93affe281c7fd69.tar.xz |
Skip BOM in XML parser which was confusing the XPS parser.
The BOM was erroneously being emitted as a text node.
Diffstat (limited to 'fitz/base_xml.c')
-rw-r--r-- | fitz/base_xml.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/fitz/base_xml.c b/fitz/base_xml.c index ac63659a..d9ae68c1 100644 --- a/fitz/base_xml.c +++ b/fitz/base_xml.c @@ -46,8 +46,8 @@ void fz_debug_xml(fz_xml *item, int level) else { printf("/>\n"); } - item = item->next; } + item = item->next; } } @@ -389,6 +389,7 @@ static char *convert_to_utf8(fz_context *doc, unsigned char *s, int n) int c; if (s[0] == 0xFE && s[1] == 0xFF) { + s += 2; dst = d = fz_malloc(doc, n * 2); while (s + 1 < e) { c = s[0] << 8 | s[1]; @@ -400,6 +401,7 @@ static char *convert_to_utf8(fz_context *doc, unsigned char *s, int n) } if (s[0] == 0xFF && s[1] == 0xFE) { + s += 2; dst = d = fz_malloc(doc, n * 2); while (s + 1 < e) { c = s[0] | s[1] << 8; |