aboutsummaryrefslogtreecommitdiffstats
path: root/libqpdf/QPDF_Stream.cc
diff options
context:
space:
mode:
Diffstat (limited to 'libqpdf/QPDF_Stream.cc')
-rw-r--r--libqpdf/QPDF_Stream.cc19
1 files changed, 19 insertions, 0 deletions
diff --git a/libqpdf/QPDF_Stream.cc b/libqpdf/QPDF_Stream.cc
index 1f48b2c1..87c2daa9 100644
--- a/libqpdf/QPDF_Stream.cc
+++ b/libqpdf/QPDF_Stream.cc
@@ -40,6 +40,19 @@ QPDF_Stream::~QPDF_Stream()
{
}
+void
+QPDF_Stream::setObjGen(int objid, int generation)
+{
+ if (! ((this->objid == 0) && (this->generation == 0)))
+ {
+ throw std::logic_error(
+ "attempt to set object ID and generation of a stream"
+ " that already has them");
+ }
+ this->objid = objid;
+ this->generation = generation;
+}
+
std::string
QPDF_Stream::unparse()
{
@@ -353,6 +366,12 @@ QPDF_Stream::pipeStreamData(Pipeline* pipeline, bool filter,
QUtil::int_to_string(desired_length) + " bytes");
}
}
+ else if (this->offset == 0)
+ {
+ QTC::TC("qpdf", "QPDF_Stream pipe no stream data");
+ throw std::logic_error(
+ "pipeStreamData called for stream with no data");
+ }
else
{
QTC::TC("qpdf", "QPDF_Stream pipe original stream data");