aboutsummaryrefslogtreecommitdiffstats
path: root/libqpdf
diff options
context:
space:
mode:
authorJay Berkenbilt <ejb@ql.org>2009-10-05 01:56:56 +0200
committerJay Berkenbilt <ejb@ql.org>2009-10-05 01:56:56 +0200
commitc1e53f148096c329650068694fbde82f018560bf (patch)
tree574be45750f1693f19cf07385e6bcb13a62d4d67 /libqpdf
parentbfdd26fb23d6ecb2cfc6cd2b02b25a4f9378f7dd (diff)
downloadqpdf-c1e53f148096c329650068694fbde82f018560bf.tar.zst
bug fix: more gracefully handle xref stream with too many entries
git-svn-id: svn+q:///qpdf/trunk@747 71b93d88-0707-0410-a8cf-f5a4172ac649
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;