From b3c4ca3439eea5f81f3e5a98830829fa20c22823 Mon Sep 17 00:00:00 2001 From: Luboš Luňák Date: Thu, 16 Jul 2020 10:47:18 +0200 Subject: properly finish encrypting when parallel zip saving (tdf#134796) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit More fixing of 353d4528b8ad8ab, that I didn't get quite right in 08161f853571e3. There must be one final processDeflated() call that has isDeflaterFinished() return true, so that encrypting is finalized properly. Change-Id: Id15190cc467a801ccc57e1efe802cdd8fc618a71 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/98878 Tested-by: Luboš Luňák Reviewed-by: Luboš Luňák --- package/source/zipapi/ZipOutputEntry.cxx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/package/source/zipapi/ZipOutputEntry.cxx b/package/source/zipapi/ZipOutputEntry.cxx index c9a4943cbe19..5115c7a3ebc1 100644 --- a/package/source/zipapi/ZipOutputEntry.cxx +++ b/package/source/zipapi/ZipOutputEntry.cxx @@ -374,6 +374,8 @@ void ZipOutputEntryParallel::writeStream(const uno::Reference< io::XInputStream processDeflated(rBuffer, nLen); } ); + finished = true; + processDeflated( uno::Sequence< sal_Int8 >(), 0 ); // finish encrypting, etc. totalIn = deflater.getTotalIn(); totalOut = deflater.getTotalOut(); closeEntry(); @@ -382,7 +384,6 @@ void ZipOutputEntryParallel::writeStream(const uno::Reference< io::XInputStream void ZipOutputEntryParallel::finishDeflater() { // ThreadedDeflater is called synchronously in one call, so nothing to do here. - finished = true; } sal_Int64 ZipOutputEntryParallel::getDeflaterTotalIn() const -- cgit