summaryrefslogtreecommitdiff
path: root/pdf/pdf_xref.c
diff options
context:
space:
mode:
Diffstat (limited to 'pdf/pdf_xref.c')
-rw-r--r--pdf/pdf_xref.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/pdf/pdf_xref.c b/pdf/pdf_xref.c
index 0be3740f..b3455773 100644
--- a/pdf/pdf_xref.c
+++ b/pdf/pdf_xref.c
@@ -230,6 +230,9 @@ pdf_read_old_xref(pdf_document *xref, pdf_lexbuf *buf)
fz_seek(xref->file, -(2 + (int)strlen(s)), 1);
}
+ if (ofs < 0)
+ fz_throw(xref->ctx, "out of range object num in xref: %d", ofs);
+
/* broken pdfs where size in trailer undershoots entries in xref sections */
if (ofs + len > xref->len)
{