Remove infinite loop on certain stream copy failures

Instead we get an error message now
This commit is contained in:
nattthebear 2020-09-18 18:10:40 -04:00
parent 0d72cd901a
commit 302b12cda8
1 changed files with 2 additions and 0 deletions

View File

@ -15,6 +15,8 @@ namespace BizHawk.BizInvoke
while (len > 0)
{
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);
len -= r;
}