summaryrefslogtreecommitdiff
path: root/source/pdf
diff options
context:
space:
mode:
authorRobin Watts <robin.watts@artifex.com>2015-06-02 11:04:07 +0100
committerRobin Watts <robin.watts@artifex.com>2015-06-02 11:12:23 +0100
commit9749705532751f8faa53eb563545540829cb5f95 (patch)
tree6fd4920432dd32d2803af732aa7972905e96c6df /source/pdf
parente513c5587954b85e29fd3c35207afab94c1b024f (diff)
downloadmupdf-9749705532751f8faa53eb563545540829cb5f95.tar.xz
Fix FZ_LARGEFILE operation for large files with old style xrefs.
I'd missed converting some int's to fz_off_t's.
Diffstat (limited to 'source/pdf')
-rw-r--r--source/pdf/pdf-xref.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/source/pdf/pdf-xref.c b/source/pdf/pdf-xref.c
index bba189a2..e06ae224 100644
--- a/source/pdf/pdf-xref.c
+++ b/source/pdf/pdf-xref.c
@@ -516,9 +516,9 @@ pdf_read_start_xref(fz_context *ctx, pdf_document *doc)
static int
pdf_xref_size_from_old_trailer(fz_context *ctx, pdf_document *doc, pdf_lexbuf *buf)
{
- int len;
+ fz_off_t len;
char *s;
- int t;
+ fz_off_t t;
pdf_token tok;
int c;
int size;
@@ -545,7 +545,7 @@ pdf_xref_size_from_old_trailer(fz_context *ctx, pdf_document *doc, pdf_lexbuf *b
fz_strsep(&s, " "); /* ignore ofs */
if (!s)
fz_throw(ctx, FZ_ERROR_GENERIC, "invalid range marker in xref");
- len = fz_atoi(fz_strsep(&s, " "));
+ len = fz_atoo(fz_strsep(&s, " "));
if (len < 0)
fz_throw(ctx, FZ_ERROR_GENERIC, "xref range marker must be positive");
@@ -556,7 +556,7 @@ pdf_xref_size_from_old_trailer(fz_context *ctx, pdf_document *doc, pdf_lexbuf *b
t = fz_tell(ctx, doc->file);
if (t < 0)
fz_throw(ctx, FZ_ERROR_GENERIC, "cannot tell in file");
- if (len > (INT_MAX - t) / 20)
+ if (len > (FZ_OFF_MAX - t) / 20)
fz_throw(ctx, FZ_ERROR_GENERIC, "xref has too many entries");
fz_seek(ctx, doc->file, t + 20 * len, SEEK_SET);