summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--source/pdf/pdf-xref.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/source/pdf/pdf-xref.c b/source/pdf/pdf-xref.c
index 3ce2cb01..14b8b5bd 100644
--- a/source/pdf/pdf-xref.c
+++ b/source/pdf/pdf-xref.c
@@ -862,6 +862,8 @@ pdf_read_old_xref(fz_context *ctx, pdf_document *doc, pdf_lexbuf *buf)
if (ofs < 0)
fz_throw(ctx, FZ_ERROR_GENERIC, "out of range object num in xref: %d", (int)ofs);
+ if (ofs > FZ_OFF_MAX - len)
+ fz_throw(ctx, FZ_ERROR_GENERIC, "xref section object numbers too big");
/* broken pdfs where size in trailer undershoots entries in xref sections */
if (ofs + len > xref_len)