aboutsummaryrefslogtreecommitdiffstats
path: root/libqpdf/QPDF_Stream.cc
diff options
context:
space:
mode:
authorJay Berkenbilt <ejb@ql.org>2021-02-14 20:04:40 +0100
committerJay Berkenbilt <ejb@ql.org>2021-02-14 20:42:24 +0100
commitefbb21673c59cfbf6a74de6866a59cb2dbb8e59f (patch)
tree37439ac43400705551107542c9e9939ee8504294 /libqpdf/QPDF_Stream.cc
parente2593e2efe140d47870b0c511cbf5160db080edd (diff)
downloadqpdf-efbb21673c59cfbf6a74de6866a59cb2dbb8e59f.tar.zst
Add functional versions of QPDFObjectHandle::replaceStreamData
Also fix a bug in checking consistency of length for stream data providers. Length should not be checked or recorded if the provider says it failed to generate the data.
Diffstat (limited to 'libqpdf/QPDF_Stream.cc')
-rw-r--r--libqpdf/QPDF_Stream.cc4
1 files changed, 2 insertions, 2 deletions
diff --git a/libqpdf/QPDF_Stream.cc b/libqpdf/QPDF_Stream.cc
index b05137df..bc3b1b56 100644
--- a/libqpdf/QPDF_Stream.cc
+++ b/libqpdf/QPDF_Stream.cc
@@ -533,7 +533,7 @@ QPDF_Stream::pipeStreamData(Pipeline* pipeline, bool* filterp,
}
qpdf_offset_t actual_length = count.getCount();
qpdf_offset_t desired_length = 0;
- if (this->stream_dict.hasKey("/Length"))
+ if (success && this->stream_dict.hasKey("/Length"))
{
desired_length = this->stream_dict.getKey("/Length").getIntValue();
if (actual_length == desired_length)
@@ -555,7 +555,7 @@ QPDF_Stream::pipeStreamData(Pipeline* pipeline, bool* filterp,
QUtil::int_to_string(desired_length) + " bytes");
}
}
- else
+ else if (success)
{
QTC::TC("qpdf", "QPDF_Stream provider length not provided");
this->stream_dict.replaceKey(