diff options
author | Max Kellermann <max@musicpd.org> | 2020-09-04 18:01:22 +0200 |
---|---|---|
committer | Max Kellermann <max@musicpd.org> | 2020-09-04 18:01:29 +0200 |
commit | db46d84458be54fedd89613f881ffe6181bdb03e (patch) | |
tree | 905851e4617ddd25d04422b9d9ed8b8530f55dc2 /src/archive | |
parent | 9e6c4f8d80c4c7b0af9b728fe7c710784534026c (diff) |
archive/bzip2: move the eof check out of the ScopeUnlock
Diffstat (limited to 'src/archive')
-rw-r--r-- | src/archive/plugins/Bzip2ArchivePlugin.cxx | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/archive/plugins/Bzip2ArchivePlugin.cxx b/src/archive/plugins/Bzip2ArchivePlugin.cxx index 0228fa743..8e7ebab2c 100644 --- a/src/archive/plugins/Bzip2ArchivePlugin.cxx +++ b/src/archive/plugins/Bzip2ArchivePlugin.cxx @@ -136,14 +136,14 @@ Bzip2InputStream::FillBuffer() size_t Bzip2InputStream::Read(void *ptr, size_t length) { + if (eof) + return 0; + const ScopeUnlock unlock(mutex); int bz_result; size_t nbytes = 0; - if (eof) - return 0; - bzstream.next_out = (char *)ptr; bzstream.avail_out = length; |