Commit 18c52640cc1aa18113b950aaf29bedcb68da31b0

Authored by m-holger
1 parent c93b149b

Refine #1225

Showing 1 changed file with 3 additions and 0 deletions
libqpdf/Pl_DCT.cc
@@ -318,6 +318,9 @@ Pl_DCT::decompress(void* cinfo_p, Buffer* b) @@ -318,6 +318,9 @@ Pl_DCT::decompress(void* cinfo_p, Buffer* b)
318 // jpeg_start_decompress is called. During normal use of qpdf very large JPEGs can occasionally 318 // jpeg_start_decompress is called. During normal use of qpdf very large JPEGs can occasionally
319 // occur legitimately and therefore must be allowed during normal operations. 319 // occur legitimately and therefore must be allowed during normal operations.
320 cinfo->mem->max_memory_to_use = 1'000'000'000; 320 cinfo->mem->max_memory_to_use = 1'000'000'000;
  321 + // For some corrupt files the memory used internally by libjpeg stays within the above limits
  322 + // even though the size written to the next pipeline is significantly larger.
  323 + m->corrupt_data_limit = 100'000'000;
321 #endif 324 #endif
322 jpeg_buffer_src(cinfo, b); 325 jpeg_buffer_src(cinfo, b);
323 326