summaryrefslogtreecommitdiff
path: root/fitz
diff options
context:
space:
mode:
authorTor Andersson <tor@ghostscript.com>2010-06-23 12:13:44 +0200
committerTor Andersson <tor@ghostscript.com>2010-06-23 12:13:44 +0200
commit11316784bc93baba649d3905e66522a85e1212d8 (patch)
tree5fbbfef63fa70518512fb6935bacd1209a23fb6b /fitz
parent5b23ef9da8c56458e28b84274159d3cb22696c57 (diff)
downloadmupdf-11316784bc93baba649d3905e66522a85e1212d8.tar.xz
Allow flate streams to have data check errors at the end.
Diffstat (limited to 'fitz')
-rw-r--r--fitz/filt_flate.c7
1 files changed, 6 insertions, 1 deletions
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;
}