From 81cfadfe32e31b7b954b2b41a94fd76ed706a067 Mon Sep 17 00:00:00 2001 From: Adrian Conlon Date: Wed, 1 May 2019 22:47:40 +0100 Subject: [PATCH] Correct byte array load issue: Ensure maximum number of bytes to read is set correctly. Signed-off-by: Adrian Conlon --- EightBit/Rom.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/EightBit/Rom.cs b/EightBit/Rom.cs index b4c6cac..640cb0d 100644 --- a/EightBit/Rom.cs +++ b/EightBit/Rom.cs @@ -75,7 +75,7 @@ namespace EightBit { if (limit < 0) { - limit = this.Size - readOffset; + limit = Math.Min(from.Length, this.Size - readOffset); } var extent = limit + writeOffset;