diff options
author | Tor Andersson <tor@ghostscript.com> | 2010-01-17 15:31:47 +0100 |
---|---|---|
committer | Tor Andersson <tor@ghostscript.com> | 2010-01-17 15:31:47 +0100 |
commit | 76a6d66d699240d6ca0035643c26b244890607b8 (patch) | |
tree | 94eed0ef211faa85fdcb651c34924fb59099bd17 | |
parent | df2524f943c72e4fd6b2455244d23c754b05354e (diff) | |
download | mupdf-76a6d66d699240d6ca0035643c26b244890607b8.tar.xz |
Workaround for files where the ID keyword is followed by \r\n instead of one (1) whitespace character as required by the spec.
-rw-r--r-- | mupdf/pdf_interpret.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/mupdf/pdf_interpret.c b/mupdf/pdf_interpret.c index 0caf29f0..7fc270b3 100644 --- a/mupdf/pdf_interpret.c +++ b/mupdf/pdf_interpret.c @@ -1448,13 +1448,17 @@ pdf_runcsi(pdf_csi *csi, pdf_xref *xref, fz_obj *rdb, fz_stream *file) if (!strcmp(buf, "BI")) { fz_obj *obj; + int ch; error = pdf_parsedict(&obj, xref, file, buf, sizeof buf); if (error) return fz_rethrow(error, "cannot parse inline image dictionary"); /* read whitespace after ID keyword */ - fz_readbyte(file); + ch = fz_readbyte(file); + if (ch == '\r') + if (fz_peekbyte(file) == '\n') + fz_readbyte(file); error = fz_readerror(file); if (error) return fz_rethrow(error, "cannot parse whitespace before inline image"); |