]> git.ipfire.org Git - thirdparty/zstd.git/commitdiff
[pzstd] Fix deadlock in the case of errors 733/head
authorNick Terrell <terrelln@fb.com>
Fri, 23 Jun 2017 01:09:42 +0000 (18:09 -0700)
committerNick Terrell <terrelln@fb.com>
Fri, 23 Jun 2017 01:09:42 +0000 (18:09 -0700)
Fixes #720.

contrib/pzstd/Pzstd.cpp

index 1265b53efc0bca6fc34c79f6e2ffef4e9435eae4..ae5d7344441324339644c7aad0aa5b18e988a2c2 100644 (file)
@@ -585,7 +585,10 @@ std::uint64_t writeFile(
   std::uint64_t bytesWritten = 0;
   std::shared_ptr<BufferWorkQueue> out;
   // Grab the output queue for each decompression job (in order).
-  while (outs.pop(out) && !errorHolder.hasError()) {
+  while (outs.pop(out)) {
+    if (errorHolder.hasError()) {
+      continue;
+    }
     if (!decompress) {
       // If we are compressing and want to write skippable frames we can't
       // start writing before compression is done because we need to know the