[gs-commits] mupdf/master - 0_6-255-g957e277 - Ignore premature end of data in zlib filter.

Tor Andersson tor at ghostscript.com
Tue Aug 3 12:09:49 UTC 2010


commit 957e277cf8259c79abf2e6d59b5f37212b96ed27
Author: Tor Andersson <tor at ghostscript.com>
Date:   Mon Aug 2 12:49:07 2010 +0000

    Ignore premature end of data in zlib filter.
    
    Ignore-this: 9bf43c583036440aae620d89a3605e78
    
    darcs-hash:20100802124907-f546f-290d558a0138b68996cdb034580996c729ec8952.gz

 2 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/fitz/filt_flate.c b/fitz/filt_flate.c
index 1e22d02..d5db9b0 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 75e10ee..ff81282 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
 	{

--
git/hooks/post-receive


More information about the gs-commits mailing list