diff options
author | Robin Watts <robin.watts@artifex.com> | 2012-07-04 20:10:28 +0100 |
---|---|---|
committer | Robin Watts <robin.watts@artifex.com> | 2012-07-05 11:01:52 +0100 |
commit | 8ff2db02dba00a0fbc53ee4c89dcab60aab181ec (patch) | |
tree | 7f3995a5ed53b9e304b4ad98de4c04bd9860ca01 | |
parent | f23e5052e23a42057ef2c4025a38b9fc29ccd00c (diff) | |
download | mupdf-8ff2db02dba00a0fbc53ee4c89dcab60aab181ec.tar.xz |
Cope with negative lengths being passed to fz_open_null
normal_994.pdf SEGVs due to a negative length. Simple fix to treat
negative length streams as 0 length.
-rw-r--r-- | fitz/filt_basic.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/fitz/filt_basic.c b/fitz/filt_basic.c index ef6dc920..378abe21 100644 --- a/fitz/filt_basic.c +++ b/fitz/filt_basic.c @@ -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); |