aboutsummaryrefslogtreecommitdiffstats
path: root/libqpdf
diff options
context:
space:
mode:
authorJay Berkenbilt <ejb@ql.org>2018-06-22 16:44:08 +0200
committerJay Berkenbilt <ejb@ql.org>2018-06-22 16:44:08 +0200
commit38c9ed23c3d05c6c217db287ae15c97498a69dd7 (patch)
tree9f3481554ad5ea1d26e4845a849eebe7980cb761 /libqpdf
parent6c89d4b35bda528813b7ae9a39a1819af16a1fd0 (diff)
downloadqpdf-38c9ed23c3d05c6c217db287ae15c97498a69dd7.tar.zst
Treat content stream parsing errors as an error, not a warning
If parsing content streams is treated as a warning, there is no way for a caller to know if a parsing operation has failed. This is very dangerous and will likely result in data loss when token filters are parser callbacks are in use.
Diffstat (limited to 'libqpdf')
-rw-r--r--libqpdf/QPDFObjectHandle.cc7
1 files changed, 3 insertions, 4 deletions
diff --git a/libqpdf/QPDFObjectHandle.cc b/libqpdf/QPDFObjectHandle.cc
index d1bc58ca..f4a8a0a4 100644
--- a/libqpdf/QPDFObjectHandle.cc
+++ b/libqpdf/QPDFObjectHandle.cc
@@ -1290,10 +1290,9 @@ QPDFObjectHandle::pipeContentStreams(
if (! stream.pipeStreamData(p, 0, qpdf_dl_specialized))
{
QTC::TC("qpdf", "QPDFObjectHandle errors in parsecontent");
- warn(stream.getOwningQPDF(),
- QPDFExc(qpdf_e_damaged_pdf, "content stream",
- description, 0,
- "errors while decoding content stream"));
+ throw QPDFExc(qpdf_e_damaged_pdf, "content stream",
+ description, 0,
+ "errors while decoding content stream");
}
}
}