aboutsummaryrefslogtreecommitdiffstats
path: root/libqpdf/QPDF.cc
diff options
context:
space:
mode:
Diffstat (limited to 'libqpdf/QPDF.cc')
-rw-r--r--libqpdf/QPDF.cc7
1 files changed, 7 insertions, 0 deletions
diff --git a/libqpdf/QPDF.cc b/libqpdf/QPDF.cc
index fc0c103f..d1360b14 100644
--- a/libqpdf/QPDF.cc
+++ b/libqpdf/QPDF.cc
@@ -917,6 +917,13 @@ QPDF::processXRefStream(qpdf_offset_t xref_offset, QPDFObjectHandle& xref_obj)
}
entry_size += W[i];
}
+ if (entry_size == 0)
+ {
+ throw QPDFExc(qpdf_e_damaged_pdf, this->file->getName(),
+ "xref stream", xref_offset,
+ "Cross-reference stream's /W indicates"
+ " entry size of 0");
+ }
long long max_num_entries =
static_cast<unsigned long long>(-1) / entry_size;