aboutsummaryrefslogtreecommitdiffstats
path: root/libqpdf
diff options
context:
space:
mode:
Diffstat (limited to 'libqpdf')
-rw-r--r--libqpdf/QPDF.cc16
1 files changed, 12 insertions, 4 deletions
diff --git a/libqpdf/QPDF.cc b/libqpdf/QPDF.cc
index 8f275b74..dbbd5517 100644
--- a/libqpdf/QPDF.cc
+++ b/libqpdf/QPDF.cc
@@ -787,10 +787,18 @@ QPDF::processXRefStream(off_t xref_offset, QPDFObjectHandle& xref_obj)
if (expected_size != actual_size)
{
- throw QPDFExc(this->file.getName(), xref_offset,
- "Cross-reference stream data has the wrong size;"
- " expected = " + QUtil::int_to_string(expected_size) +
- "; actual = " + QUtil::int_to_string(actual_size));
+ QPDFExc x(this->file.getName(), xref_offset,
+ "Cross-reference stream data has the wrong size;"
+ " expected = " + QUtil::int_to_string(expected_size) +
+ "; actual = " + QUtil::int_to_string(actual_size));
+ if (expected_size > actual_size)
+ {
+ throw x;
+ }
+ else
+ {
+ warn(x);
+ }
}
int cur_chunk = 0;