diff --git a/ArcFormats/Marble/ImagePRS.cs b/ArcFormats/Marble/ImagePRS.cs index 7386b88f..fe76bf8a 100644 --- a/ArcFormats/Marble/ImagePRS.cs +++ b/ArcFormats/Marble/ImagePRS.cs @@ -189,6 +189,7 @@ namespace GameRes.Formats.Marble ++shift; if (dst < shift) throw new InvalidFormatException ("Invalid offset value"); + length = Math.Min (length, m_output.Length - dst); Binary.CopyOverlapped (m_output, dst-shift, dst, length); dst += length; }