Be more strict about alignment

This commit is contained in:
ds5678 2025-03-01 18:31:47 -08:00
parent f9ba652b09
commit 0125475c0a

View File

@ -122,7 +122,7 @@ namespace AssetRipper.IO.Files.BundleFiles.FileStream
{
// Note: metadataSize might not be a multiple of 4
}
else if ((metadataPosition % 4 == 0) && (metadataSize % 4 == 0) && (metadataBytesRead + 3 >= metadataSize))
else if ((metadataPosition % 4 == 0) && (metadataSize % 4 == 0) && (((metadataBytesRead + 3) & ~3) == metadataSize))
{
// The stream needed to be aligned to 4 bytes.
// https://github.com/AssetRipper/AssetRipper/issues/1470