From 6a7d53ad2bc9c7eb5964b5c0424616e8b3f068cd Mon Sep 17 00:00:00 2001 From: Jay Berkenbilt Date: Sat, 29 Jul 2017 12:07:19 -0400 Subject: Handle zlib data errors better (fixes #106) --- libqpdf/QPDF.cc | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'libqpdf/QPDF.cc') diff --git a/libqpdf/QPDF.cc b/libqpdf/QPDF.cc index 56555261..bda87f01 100644 --- a/libqpdf/QPDF.cc +++ b/libqpdf/QPDF.cc @@ -2206,7 +2206,7 @@ QPDF::pipeStreamData(int objid, int generation, warn(e); } } - catch (std::runtime_error& e) + catch (std::exception& e) { if (! suppress_warnings) { @@ -2218,7 +2218,14 @@ QPDF::pipeStreamData(int objid, int generation, QUtil::int_to_string(generation) + ": " + e.what())); } } - pipeline->finish(); + try + { + pipeline->finish(); + } + catch (std::exception&) + { + // ignore + } return success; } -- cgit v1.2.3-54-g00ecf