Fixed exception being thrown when resizing external memory smaller

This commit is contained in:
Lee Fogg 2020-04-26 21:55:07 +01:00
parent 21fb6e3261
commit 5fce5f11cb
1 changed files with 1 additions and 1 deletions

View File

@ -45,7 +45,7 @@ namespace Emux.GameBoy.Cartridge
{
var backup = _externalMemory;
_externalMemory = new byte[length];
Array.Copy(backup, _externalMemory, length);
Array.Copy(backup, _externalMemory, Math.Min(backup.Length, length));
}
else
{