From 09f2e173850e011e6390c49a4f761e87dd87ffba Mon Sep 17 00:00:00 2001 From: Tor Andersson Date: Tue, 10 Jul 2018 12:58:57 +0200 Subject: Clean up null/range/endstream filter. Use separate functions to keep the code simpler. Use memmem to simplify and optimize search for 'endstream' token. Do not look for 'endobj' since that could cause a false positives in compressed object streams that have duff lengths. --- include/mupdf/fitz/filter.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'include') diff --git a/include/mupdf/fitz/filter.h b/include/mupdf/fitz/filter.h index bdce36e8..5dd136a1 100644 --- a/include/mupdf/fitz/filter.h +++ b/include/mupdf/fitz/filter.h @@ -12,12 +12,12 @@ typedef struct fz_jbig2_globals_s fz_jbig2_globals; typedef struct { int64_t offset; - int len; + size_t length; } fz_range; -fz_stream *fz_open_null_n(fz_context *ctx, fz_stream *chain, fz_range *ranges, int nranges); -fz_stream *fz_open_null(fz_context *ctx, fz_stream *chain, int len, int64_t offset); -fz_stream *fz_open_pdf_stream(fz_context *ctx, fz_stream *chain, int len, int64_t offset); +fz_stream *fz_open_null_filter(fz_context *ctx, fz_stream *chain, int len, int64_t offset); +fz_stream *fz_open_range_filter(fz_context *ctx, fz_stream *chain, fz_range *ranges, int nranges); +fz_stream *fz_open_endstream_filter(fz_context *ctx, fz_stream *chain, int len, int64_t offset); fz_stream *fz_open_concat(fz_context *ctx, int max, int pad); void fz_concat_push_drop(fz_context *ctx, fz_stream *concat, fz_stream *chain); /* Ownership of chain is passed in */ fz_stream *fz_open_arc4(fz_context *ctx, fz_stream *chain, unsigned char *key, unsigned keylen); -- cgit v1.2.3