From c1e53f148096c329650068694fbde82f018560bf Mon Sep 17 00:00:00 2001 From: Jay Berkenbilt Date: Sun, 4 Oct 2009 23:56:56 +0000 Subject: bug fix: more gracefully handle xref stream with too many entries git-svn-id: svn+q:///qpdf/trunk@747 71b93d88-0707-0410-a8cf-f5a4172ac649 --- libqpdf/QPDF.cc | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) (limited to 'libqpdf') 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; -- cgit v1.2.3-54-g00ecf