From 0eb29c7357f744088a6e6f275ac439b7a7071d25 Mon Sep 17 00:00:00 2001 From: m-holger Date: Fri, 9 Aug 2024 11:08:30 +0100 Subject: [PATCH] If Pl_Flate memory limit is exceeded do not attempt 'finish' processing --- libqpdf/Pl_Flate.cc | 3 +++ 1 file changed, 3 insertions(+) diff --git a/libqpdf/Pl_Flate.cc b/libqpdf/Pl_Flate.cc index dd50f902..b9ad8a02 100644 --- a/libqpdf/Pl_Flate.cc +++ b/libqpdf/Pl_Flate.cc @@ -204,6 +204,9 @@ Pl_Flate::handleData(unsigned char const* data, size_t len, int flush) void Pl_Flate::finish() { + if (m->written > memory_limit) { + return; + } try { if (m->outbuf.get()) { if (m->initialized) {