From ab0ef6f3c5302e9b2722d6ef09146f1cdffe47ea Mon Sep 17 00:00:00 2001 From: morkt Date: Wed, 23 Dec 2015 09:39:51 +0400 Subject: [PATCH] flags are actually bitflags. --- ArcFormats/Marble/ImagePRS.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ArcFormats/Marble/ImagePRS.cs b/ArcFormats/Marble/ImagePRS.cs index b1e1eeb5..cbf07ba2 100644 --- a/ArcFormats/Marble/ImagePRS.cs +++ b/ArcFormats/Marble/ImagePRS.cs @@ -129,6 +129,8 @@ namespace GameRes.Formats.Marble --remaining; bit = 0x80; } + if (remaining <= 0) + break; if (0 == (ctl & bit)) { m_output[dst++] = m_input.ReadByte(); @@ -184,7 +186,7 @@ namespace GameRes.Formats.Marble Binary.CopyOverlapped (m_output, dst-shift, dst, length); dst += length; } - if (m_flag != 0) + if ((m_flag & 0x80) != 0) { for (int i = 3; i < m_output.Length; ++i) m_output[i] += m_output[i-3];