From 50cc85d465a631c3bdbf204e6ab8bc7c97431eb6 Mon Sep 17 00:00:00 2001 From: Robin Watts Date: Wed, 27 Jun 2012 18:04:57 +0100 Subject: Make ASCII85 decoding more tolerant of end of stream errors. This solves the normal_87.pdf rendering issues. --- fitz/filt_basic.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'fitz') diff --git a/fitz/filt_basic.c b/fitz/filt_basic.c index 7d504f29..ef6dc920 100644 --- a/fitz/filt_basic.c +++ b/fitz/filt_basic.c @@ -350,7 +350,11 @@ read_a85d(fz_stream *stm, unsigned char *buf, int len) case 0: break; case 1: - fz_throw(stm->ctx, "partial final byte in a85d"); + /* Specifically illegal in the spec, but adobe + * and gs both cope. See normal_87.pdf for a + * case where this matters. */ + fz_warn(stm->ctx, "partial final byte in a85d"); + break; case 2: word = word * (85 * 85 * 85) + 0xffffff; state->bp[0] = word >> 24; -- cgit v1.2.3