From 65662783ec46f62cf8b73e91db84f221e2f5263b Mon Sep 17 00:00:00 2001 From: morkt Date: Sat, 30 Mar 2019 18:48:14 +0400 Subject: [PATCH] (PRS): limit decompressed block size. --- ArcFormats/Marble/ImagePRS.cs | 1 + 1 file changed, 1 insertion(+) 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 @@ public void Unpack () ++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; }