summaryrefslogtreecommitdiff
path: root/package/source/zippackage/ZipPackageStream.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'package/source/zippackage/ZipPackageStream.cxx')
-rw-r--r--package/source/zippackage/ZipPackageStream.cxx6
1 files changed, 5 insertions, 1 deletions
diff --git a/package/source/zippackage/ZipPackageStream.cxx b/package/source/zippackage/ZipPackageStream.cxx
index 1d6cd237c8e1..569368160f7f 100644
--- a/package/source/zippackage/ZipPackageStream.cxx
+++ b/package/source/zippackage/ZipPackageStream.cxx
@@ -820,9 +820,13 @@ bool ZipPackageStream::saveChild(
{
// tdf#89236 Encrypting in parallel does not work
bParallelDeflate = !bToBeEncrypted;
- // Do not deflate small streams in a thread
+ // Do not deflate small streams in a thread. XSeekable's getLength()
+ // gives the full size, XInputStream's available() may not be
+ // the full size, but it appears that at this point it usually is.
if (xSeek.is() && xSeek->getLength() < 100000)
bParallelDeflate = false;
+ else if (xStream->available() < 100000)
+ bParallelDeflate = false;
if (bParallelDeflate)
{