From: Nick Terrell Date: Fri, 23 Jun 2017 01:09:42 +0000 (-0700) Subject: [pzstd] Fix deadlock in the case of errors X-Git-Tag: v1.3.0~1^2~16^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=refs%2Fpull%2F733%2Fhead;p=thirdparty%2Fzstd.git [pzstd] Fix deadlock in the case of errors Fixes #720. --- diff --git a/contrib/pzstd/Pzstd.cpp b/contrib/pzstd/Pzstd.cpp index 1265b53ef..ae5d73444 100644 --- a/contrib/pzstd/Pzstd.cpp +++ b/contrib/pzstd/Pzstd.cpp @@ -585,7 +585,10 @@ std::uint64_t writeFile( std::uint64_t bytesWritten = 0; std::shared_ptr 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