(AImageReader): slight fault tolerance.

This commit is contained in:
morkt
2016-10-24 04:58:18 +04:00
parent 1876bfb02b
commit 17e8c7efca

View File

@@ -210,7 +210,7 @@ namespace GameRes.Formats.Cyberworks
if (has_alpha || (bit & rgb_map[bit_src]) != 0)
{
m_input.Read (m_output, dst, 3);
if (has_alpha)
if (has_alpha && alpha_src < alpha.Length)
{
m_output[dst+3] = alpha[alpha_src];
alpha_src += 3;