Check for underflow and overflow

This commit is contained in:
Jeremy Pritts 2023-01-22 20:32:16 -05:00
parent e422e89e00
commit 1f58990edb
3 changed files with 6 additions and 2 deletions

View File

@ -94,7 +94,7 @@ public class SerializedAssetCollection : AssetCollection
for (int i = 0; i < file.Metadata.Object.Length; i++)
{
ObjectInfo objectInfo = file.Metadata.Object[i];
if (objectInfo.ClassID == 115)//MonoScript
if (objectInfo.TypeID == 115)//MonoScript
{
if (!collection.Assets.ContainsKey(objectInfo.FileID))
{

View File

@ -157,7 +157,10 @@ namespace AssetRipper.IO.Files.SerializedFiles.Parser
{
SerializedType type = types[SerializedTypeIndex];
TypeID = type.TypeID;
ClassID = (short)type.TypeID;
if (type.TypeID < short.MaxValue)
{
ClassID = (short)type.TypeID;
}
ScriptTypeIndex = type.ScriptTypeIndex;
Stripped = type.IsStrippedType;
}

View File

@ -7,6 +7,7 @@
<DebugType>embedded</DebugType>
<DebugSymbols>true</DebugSymbols>
<AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>
<CheckForOverflowUnderflow>true</CheckForOverflowUnderflow>
<Version>0.3.0.5</Version>
<AssemblyVersion>$(Version)</AssemblyVersion>