mirror of
https://github.com/ZDoom/gzdoom.git
synced 2024-11-21 19:51:27 +00:00
fixed BufferingReader
This commit is contained in:
parent
292705ddc3
commit
f3c7e01195
3 changed files with 5 additions and 3 deletions
|
@ -334,7 +334,7 @@ int BufferingReader::FillBuffer(ptrdiff_t newpos)
|
|||
// we have read the entire file, so delete our data provider.
|
||||
baseReader.reset();
|
||||
}
|
||||
return read == newpos - bufferpos ? 0 : -1;
|
||||
return newpos == bufferpos ? 0 : -1;
|
||||
}
|
||||
|
||||
ptrdiff_t BufferingReader::Seek(ptrdiff_t offset, int origin)
|
||||
|
|
|
@ -181,7 +181,7 @@ public:
|
|||
inflateEnd (&Stream);
|
||||
}
|
||||
|
||||
ptrdiff_t Read (void *buffer, ptrdiff_t len) override
|
||||
ptrdiff_t Read (void *buffer, ptrdiff_t olen) override
|
||||
{
|
||||
int err = 0;
|
||||
|
||||
|
@ -190,6 +190,7 @@ public:
|
|||
DecompressionError("File not open");
|
||||
return 0;
|
||||
}
|
||||
auto len = olen;
|
||||
if (len == 0) return 0;
|
||||
|
||||
while (len > 0)
|
||||
|
@ -222,7 +223,7 @@ public:
|
|||
return 0;
|
||||
}
|
||||
|
||||
return len - Stream.avail_out;
|
||||
return olen - Stream.avail_out;
|
||||
}
|
||||
|
||||
void FillBuffer ()
|
||||
|
|
|
@ -42,6 +42,7 @@ public:
|
|||
{
|
||||
Length = base->Length;
|
||||
buf.resize(Length);
|
||||
bufptr = (const char*)buf.data();
|
||||
}
|
||||
|
||||
ptrdiff_t Seek(ptrdiff_t offset, int origin) override;
|
||||
|
|
Loading…
Reference in a new issue