diff options
author | Robin Watts <robin.watts@artifex.com> | 2015-05-14 17:12:42 +0100 |
---|---|---|
committer | Robin Watts <robin.watts@artifex.com> | 2015-05-15 13:06:56 +0100 |
commit | 7d5ff30c37c9e5b271fdb2b8cb3219068048322e (patch) | |
tree | 5f60d1d03235f2cff161207e00515c5a4a69ef73 /source/pdf/pdf-stream.c | |
parent | 250e8a11e1debfbd9c4fc84ad895bf923aac135e (diff) | |
download | mupdf-7d5ff30c37c9e5b271fdb2b8cb3219068048322e.tar.xz |
Support pdf files larger than 2Gig.
If FZ_LARGEFILE is defined when building, MuPDF uses 64bit offsets
for files; this allows us to open streams larger than 2Gig.
The downsides to this are that:
* The xref entries are larger.
* All PDF ints are held as 64bit things rather than 32bit things
(to cope with /Prev entries, hint stream offsets etc).
* All file positions are stored as 64bits rather than 32.
The implementation works by detecting FZ_LARGEFILE. Some #ifdeffery
in fitz/system.h sets fz_off_t to either int or int64_t as appropriate,
and sets defines for fz_fopen, fz_fseek, fz_ftell etc as required.
These call the fseeko64 etc functions on linux (and so define
_LARGEFILE64_SOURCE) and the explicit 64bit functions on windows.
Diffstat (limited to 'source/pdf/pdf-stream.c')
-rw-r--r-- | source/pdf/pdf-stream.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/source/pdf/pdf-stream.c b/source/pdf/pdf-stream.c index b7b85cc3..32440266 100644 --- a/source/pdf/pdf-stream.c +++ b/source/pdf/pdf-stream.c @@ -243,7 +243,7 @@ build_filter_chain(fz_context *ctx, fz_stream *chain, pdf_document *doc, pdf_obj * orig_num and orig_gen are used purely to seed the encryption. */ static fz_stream * -pdf_open_raw_filter(fz_context *ctx, fz_stream *chain, pdf_document *doc, pdf_obj *stmobj, int num, int orig_num, int orig_gen, int offset) +pdf_open_raw_filter(fz_context *ctx, fz_stream *chain, pdf_document *doc, pdf_obj *stmobj, int num, int orig_num, int orig_gen, fz_off_t offset) { int hascrypt; int len; @@ -273,7 +273,7 @@ pdf_open_raw_filter(fz_context *ctx, fz_stream *chain, pdf_document *doc, pdf_ob * to stream length and decrypting. */ static fz_stream * -pdf_open_filter(fz_context *ctx, pdf_document *doc, fz_stream *chain, pdf_obj *stmobj, int num, int gen, int offset, fz_compression_params *imparams) +pdf_open_filter(fz_context *ctx, pdf_document *doc, fz_stream *chain, pdf_obj *stmobj, int num, int gen, fz_off_t offset, fz_compression_params *imparams) { pdf_obj *filters; pdf_obj *params; @@ -410,7 +410,7 @@ pdf_open_stream(fz_context *ctx, pdf_document *doc, int num, int gen) } fz_stream * -pdf_open_stream_with_offset(fz_context *ctx, pdf_document *doc, int num, int gen, pdf_obj *dict, int stm_ofs) +pdf_open_stream_with_offset(fz_context *ctx, pdf_document *doc, int num, int gen, pdf_obj *dict, fz_off_t stm_ofs) { if (stm_ofs == 0) fz_throw(ctx, FZ_ERROR_GENERIC, "object is not a stream"); |