Fix regression in f9ba7978fe24a7196890af9cb7792ec8c30ab27d

This commit is contained in:
ds5678 2025-05-09 23:43:33 -07:00
parent 9c079d0a95
commit 7bfddaef9c

View File

@ -30,7 +30,7 @@ namespace AssetRipper.SourceGenerated.Extensions
return false; return false;
} }
return file.Stream.Length <= unchecked((long)(offset + size)); return file.Stream.Length >= unchecked((long)(offset + size));
} }
internal static byte[]? GetContent(Utf8String? path, ulong offset, ulong size, AssetCollection collection) internal static byte[]? GetContent(Utf8String? path, ulong offset, ulong size, AssetCollection collection)
@ -52,7 +52,7 @@ namespace AssetRipper.SourceGenerated.Extensions
} }
ResourceFile? file = collection.Bundle.ResolveResource(path.String); ResourceFile? file = collection.Bundle.ResolveResource(path.String);
if (file == null) if (file == null || file.Stream.Length < unchecked((long)(offset + size)))
{ {
return null; return null;
} }