aboutsummaryrefslogtreecommitdiffstats
path: root/libqpdf/QPDFWriter.cc
diff options
context:
space:
mode:
Diffstat (limited to 'libqpdf/QPDFWriter.cc')
-rw-r--r--libqpdf/QPDFWriter.cc4
1 files changed, 4 insertions, 0 deletions
diff --git a/libqpdf/QPDFWriter.cc b/libqpdf/QPDFWriter.cc
index 8ee322af..8d5f0682 100644
--- a/libqpdf/QPDFWriter.cc
+++ b/libqpdf/QPDFWriter.cc
@@ -2056,6 +2056,10 @@ QPDFWriter::generateObjectStreams()
std::vector<QPDFObjGen> const& eligible =
QPDF::Writer::getCompressibleObjGens(this->pdf);
unsigned int n_object_streams = (eligible.size() + 99) / 100;
+ if (n_object_streams == 0)
+ {
+ throw std::logic_error("n_object_streams == 0");
+ }
unsigned int n_per = eligible.size() / n_object_streams;
if (n_per * n_object_streams < eligible.size())
{