Commit 6883a9c80752a1549674ffa0c88dea9b517d7e51

Authored by m-holger
1 parent 466169d0

In Pl_RunLength apply memory limit before and after decoding

Showing 1 changed file with 3 additions and 0 deletions
libqpdf/Pl_RunLength.cc
... ... @@ -156,6 +156,9 @@ Pl_RunLength::finish()
156 156 unsigned char ch = 128;
157 157 next()->write(&ch, 1);
158 158 } else {
  159 + if (memory_limit && (m->out.size()) > memory_limit) {
  160 + throw std::runtime_error("Pl_RunLength memory limit exceeded");
  161 + }
159 162 next()->writeString(m->out);
160 163 }
161 164 next()->finish();
... ...