From 8aa206ef95c817db56e5108df57790493e582eca Mon Sep 17 00:00:00 2001 From: Chris Forbes Date: Wed, 4 May 2011 14:28:06 +1200 Subject: [PATCH] fix bogus copy in Blast.cs --- OpenRA.FileFormats/FileFormats/Blast.cs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/OpenRA.FileFormats/FileFormats/Blast.cs b/OpenRA.FileFormats/FileFormats/Blast.cs index 961287d5f6..443b04874c 100644 --- a/OpenRA.FileFormats/FileFormats/Blast.cs +++ b/OpenRA.FileFormats/FileFormats/Blast.cs @@ -123,7 +123,12 @@ namespace OpenRA.FileFormats len -= copy; next += (ushort)copy; - Array.Copy(outBuffer, source, outBuffer, dest, copy); + + // copy with old-fashioned memcpy semantics + // in case of overlapping ranges. this is NOT + // the same as Array.Copy() + while( copy-- > 0 ) + outBuffer[dest++] = outBuffer[source++]; // Flush window to outstream if (next == MAXWIN)