Remove infinite loop on certain stream copy failures
Instead we get an error message now
This commit is contained in:
parent
0d72cd901a
commit
302b12cda8
|
@ -15,6 +15,8 @@ namespace BizHawk.BizInvoke
|
||||||
while (len > 0)
|
while (len > 0)
|
||||||
{
|
{
|
||||||
int r = src.Read(buff, 0, (int)Math.Min(len, 65536));
|
int r = src.Read(buff, 0, (int)Math.Min(len, 65536));
|
||||||
|
if (r == 0)
|
||||||
|
throw new InvalidOperationException($"End of source stream was reached with {len} bytes left to copy!");
|
||||||
dst.Write(buff, 0, r);
|
dst.Write(buff, 0, r);
|
||||||
len -= r;
|
len -= r;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue