From 11316784bc93baba649d3905e66522a85e1212d8 Mon Sep 17 00:00:00 2001 From: Tor Andersson Date: Wed, 23 Jun 2010 12:13:44 +0200 Subject: Allow flate streams to have data check errors at the end. --- fitz/filt_flate.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'fitz') diff --git a/fitz/filt_flate.c b/fitz/filt_flate.c index 46cd4ee8..0973c4fa 100644 --- a/fitz/filt_flate.c +++ b/fitz/filt_flate.c @@ -98,7 +98,12 @@ fz_processflated(fz_filter *f, fz_buffer *in, fz_buffer *out) in->rp = in->wp - zp->avail_in; out->wp = out->ep - zp->avail_out; - if (err == Z_STREAM_END || err == Z_BUF_ERROR) + if (err == Z_DATA_ERROR && in->eof && in->rp == in->wp) + { + fz_warn("ignoring zlib error: %s", zp->msg); + return fz_iodone; + } + else if (err == Z_STREAM_END || err == Z_BUF_ERROR) { return fz_iodone; } -- cgit v1.2.3