summaryrefslogtreecommitdiff
path: root/fitz/filt_basic.c
diff options
context:
space:
mode:
authorRobin Watts <robin.watts@artifex.com>2012-07-05 17:55:18 +0100
committerRobin Watts <robin.watts@artifex.com>2012-07-05 18:02:03 +0100
commiteeaccf8444a4884801a92c0d23f66bd54c986a67 (patch)
treefc9e254dfeef4d61a80aace2f5dbbcd985580a9a /fitz/filt_basic.c
parentb81be8d34b179d48e677463bd7b66ffdea129517 (diff)
parent15fc25b0055dbdbfaf4257ac908d43fd5a2da19d (diff)
downloadmupdf-eeaccf8444a4884801a92c0d23f66bd54c986a67.tar.xz
Merge branch 'master' into forms
Diffstat (limited to 'fitz/filt_basic.c')
-rw-r--r--fitz/filt_basic.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/fitz/filt_basic.c b/fitz/filt_basic.c
index 7d504f29..db95533d 100644
--- a/fitz/filt_basic.c
+++ b/fitz/filt_basic.c
@@ -21,7 +21,7 @@ static int
read_null(fz_stream *stm, unsigned char *buf, int len)
{
struct null_filter *state = stm->state;
- int amount = MIN(len, state->remain);
+ int amount = fz_mini(len, state->remain);
int n;
fz_seek(state->chain, state->pos, 0);
@@ -46,6 +46,8 @@ fz_open_null(fz_stream *chain, int len, int offset)
struct null_filter *state;
fz_context *ctx = chain->ctx;
+ if (len < 0)
+ len = 0;
fz_try(ctx)
{
state = fz_malloc_struct(ctx, struct null_filter);
@@ -350,7 +352,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;