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;