Update ImageSeraph.cs

fix image format check
This commit is contained in:
Dir-A 2024-09-24 04:17:30 +08:00 committed by GitHub
parent 4554b82be5
commit b967d505ec
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -54,7 +54,8 @@ namespace GameRes.Formats.Seraphim
public override ImageMetaData ReadMetaData (IBinaryStream stream)
{
var header = stream.ReadHeader (0x10);
if ('C' != header[0] || 'F' != header[1] || 0 != header[3])
uint sig = header.ToUInt16(0);
if (sig != Signature)
return null;
int packed_size = header.ToInt32 (12);
if (packed_size <= 0 || packed_size > stream.Length-0x10)