(RPA): do not prepend empty header to entries.

This commit is contained in:
morkt 2017-11-09 00:14:44 +04:00
parent 857f4c544b
commit 1d59b50ea1

View File

@ -106,8 +106,11 @@ namespace GameRes.Formats.RenPy
if (tuple.Count > 2) if (tuple.Count > 2)
{ {
entry.Header = tuple[2] as byte[]; entry.Header = tuple[2] as byte[];
if (null != entry.Header) if (null != entry.Header && entry.Header.Length > 0)
{
entry.Size -= (uint)entry.Header.Length; entry.Size -= (uint)entry.Header.Length;
entry.IsPacked = true;
}
} }
dir.Add (entry); dir.Add (entry);
} }
@ -124,7 +127,7 @@ namespace GameRes.Formats.RenPy
else else
input = Stream.Null; input = Stream.Null;
var rpa_entry = entry as RpaEntry; var rpa_entry = entry as RpaEntry;
if (null == rpa_entry || null == rpa_entry.Header) if (null == rpa_entry || null == rpa_entry.Header || 0 == rpa_entry.Header.Length)
return input; return input;
return new PrefixStream (rpa_entry.Header, input); return new PrefixStream (rpa_entry.Header, input);
} }