From 18c52640cc1aa18113b950aaf29bedcb68da31b0 Mon Sep 17 00:00:00 2001 From: m-holger Date: Sat, 29 Jun 2024 14:43:39 +0100 Subject: [PATCH] Refine #1225 --- libqpdf/Pl_DCT.cc | 3 +++ 1 file changed, 3 insertions(+) diff --git a/libqpdf/Pl_DCT.cc b/libqpdf/Pl_DCT.cc index e9a98876..5875a0e9 100644 --- a/libqpdf/Pl_DCT.cc +++ b/libqpdf/Pl_DCT.cc @@ -318,6 +318,9 @@ Pl_DCT::decompress(void* cinfo_p, Buffer* b) // jpeg_start_decompress is called. During normal use of qpdf very large JPEGs can occasionally // occur legitimately and therefore must be allowed during normal operations. cinfo->mem->max_memory_to_use = 1'000'000'000; + // For some corrupt files the memory used internally by libjpeg stays within the above limits + // even though the size written to the next pipeline is significantly larger. + m->corrupt_data_limit = 100'000'000; #endif jpeg_buffer_src(cinfo, b);