aboutsummaryrefslogtreecommitdiffstats
path: root/libqpdf/QPDF.cc
diff options
context:
space:
mode:
authorJay Berkenbilt <ejb@ql.org>2017-07-26 20:38:49 +0200
committerJay Berkenbilt <ejb@ql.org>2017-07-28 00:20:31 +0200
commit40f00122b811ca5c8788856f5baf4e5e088926eb (patch)
tree3a8247e134b7624932cd5d1b29110eda39664d5a /libqpdf/QPDF.cc
parentdd8dad74f47b6068281dd605a04bc2d0b6283423 (diff)
downloadqpdf-40f00122b811ca5c8788856f5baf4e5e088926eb.tar.zst
Convert object parsing errors to warnings
QPDFObjectHandle::parseInternal now issues warnings instead of throwing exceptions for all error conditions that it finds (except internal logic errors) and has stronger recovery for things like invalid tokens and malformed dictionaries. This should improve qpdf's ability to recover from a wide range of broken files that currently cause it to fail.
Diffstat (limited to 'libqpdf/QPDF.cc')
-rw-r--r--libqpdf/QPDF.cc5
1 files changed, 3 insertions, 2 deletions
diff --git a/libqpdf/QPDF.cc b/libqpdf/QPDF.cc
index ecc13491..087013d7 100644
--- a/libqpdf/QPDF.cc
+++ b/libqpdf/QPDF.cc
@@ -334,8 +334,9 @@ QPDF::reconstruct_xref(QPDFExc& e)
{
if (this->reconstructed_xref)
{
- // Avoid xref reconstruction infinite loops
- QTC::TC("qpdf", "QPDF caught recursive xref reconstruction");
+ // Avoid xref reconstruction infinite loops. This is getting
+ // very hard to reproduce because qpdf is throwing many fewer
+ // exceptions while parsing. Most situations are warnings now.
throw e;
}