Prevent infinite loop in `BinaryReader.ReadByteBuffer` extension
This commit is contained in:
parent
51b64f63f1
commit
3c06face00
|
@ -171,6 +171,7 @@ namespace BizHawk.Common
|
|||
while (len > 0)
|
||||
{
|
||||
var done = br.Read(ret, ofs, len);
|
||||
if (done is 0) _ = br.ReadByte(); // triggers an EndOfStreamException (as there's otherwise no way to indicate this failure state to the caller)
|
||||
ofs += done;
|
||||
len -= done;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue