From 76a6d66d699240d6ca0035643c26b244890607b8 Mon Sep 17 00:00:00 2001 From: Tor Andersson Date: Sun, 17 Jan 2010 15:31:47 +0100 Subject: Workaround for files where the ID keyword is followed by \r\n instead of one (1) whitespace character as required by the spec. --- mupdf/pdf_interpret.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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"); -- cgit v1.2.3