archive/bzip2: move the eof check out of the ScopeUnlock

This commit is contained in:
Max Kellermann 2020-09-04 18:01:22 +02:00
parent 9e6c4f8d80
commit db46d84458

View File

@ -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;