diff options
author | Tor Andersson <tor@ghostscript.com> | 2010-08-02 12:49:07 +0000 |
---|---|---|
committer | Tor Andersson <tor@ghostscript.com> | 2010-08-02 12:49:07 +0000 |
commit | 724d113ed8840470ded2b32a52c9b53a4e0a5c6b (patch) | |
tree | 22d7f6d1eed5a2b34544e79f443079d11273ab5d | |
parent | 51790988f8409bd636714316fd4bccac63252d3f (diff) | |
download | mupdf-724d113ed8840470ded2b32a52c9b53a4e0a5c6b.tar.xz |
Ignore premature end of data in zlib filter.
-rw-r--r-- | fitz/filt_flate.c | 5 | ||||
-rw-r--r-- | mupdf/pdf_page.c | 4 |
2 files changed, 7 insertions, 2 deletions
diff --git a/fitz/filt_flate.c b/fitz/filt_flate.c index 1e22d02b..d5db9b05 100644 --- a/fitz/filt_flate.c +++ b/fitz/filt_flate.c @@ -44,6 +44,11 @@ readflated(fz_stream *stm, unsigned char *outbuf, int outlen) { return outlen - zp->avail_out; } + else if (code == Z_BUF_ERROR) + { + fz_warn("premature end of data in flate filter"); + return outlen - zp->avail_out; + } else if (code == Z_DATA_ERROR && zp->avail_in == 0) { fz_warn("ignoring zlib error: %s", zp->msg); diff --git a/mupdf/pdf_page.c b/mupdf/pdf_page.c index 75e10eeb..ff812827 100644 --- a/mupdf/pdf_page.c +++ b/mupdf/pdf_page.c @@ -49,13 +49,13 @@ pdf_loadpagecontents(fz_buffer **bufp, pdf_xref *xref, fz_obj *obj) { error = pdf_loadpagecontentsarray(bufp, xref, obj); if (error) - return fz_rethrow(error, "cannot load content stream array (%d %d R)", fz_tonum(obj), fz_togen(obj)); + return fz_rethrow(error, "cannot load content stream array (%d 0 R)", fz_tonum(obj)); } else if (pdf_isstream(xref, fz_tonum(obj), fz_togen(obj))) { error = pdf_loadstream(bufp, xref, fz_tonum(obj), fz_togen(obj)); if (error) - return fz_rethrow(error, "cannot load content stream (%d %d R)", fz_tonum(obj), fz_togen(obj)); + return fz_rethrow(error, "cannot load content stream (%d 0 R)", fz_tonum(obj)); } else { |