mirror of
https://github.com/crskycode/GARbro.git
synced 2024-11-27 07:34:00 +08:00
(ARC): additional sanity check.
This commit is contained in:
parent
841bbf274a
commit
6fc7c95a5c
@ -23,6 +23,7 @@
|
|||||||
// IN THE SOFTWARE.
|
// IN THE SOFTWARE.
|
||||||
//
|
//
|
||||||
|
|
||||||
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.ComponentModel.Composition;
|
using System.ComponentModel.Composition;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
@ -60,10 +61,10 @@ namespace GameRes.Formats.Libido
|
|||||||
if (0 == name_buf[j])
|
if (0 == name_buf[j])
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (0 == j)
|
if (0 == j || -1 != Array.IndexOf<byte> (name_buf, 0xFF, 0, j))
|
||||||
return null;
|
return null;
|
||||||
var name = Encodings.cp932.GetString (name_buf, 0, j);
|
var name = Encodings.cp932.GetString (name_buf, 0, j);
|
||||||
var entry = FormatCatalog.Instance.Create<PackedEntry> (name);
|
var entry = Create<PackedEntry> (name);
|
||||||
entry.UnpackedSize = file.View.ReadUInt32 (index_offset+0x14);
|
entry.UnpackedSize = file.View.ReadUInt32 (index_offset+0x14);
|
||||||
entry.Size = file.View.ReadUInt32 (index_offset+0x18);
|
entry.Size = file.View.ReadUInt32 (index_offset+0x18);
|
||||||
entry.Offset = file.View.ReadUInt32 (index_offset+0x1C);
|
entry.Offset = file.View.ReadUInt32 (index_offset+0x1C);
|
||||||
|
Loading…
Reference in New Issue
Block a user