summaryrefslogtreecommitdiff
path: root/fitz
diff options
context:
space:
mode:
authorRobin Watts <robin.watts@artifex.com>2012-07-04 20:10:28 +0100
committerRobin Watts <robin.watts@artifex.com>2012-07-05 11:01:52 +0100
commit8ff2db02dba00a0fbc53ee4c89dcab60aab181ec (patch)
tree7f3995a5ed53b9e304b4ad98de4c04bd9860ca01 /fitz
parentf23e5052e23a42057ef2c4025a38b9fc29ccd00c (diff)
downloadmupdf-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.
Diffstat (limited to 'fitz')
-rw-r--r--fitz/filt_basic.c2
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);