Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion RePKG.Application/Constants.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,5 @@ internal static class Constants
public const int MaximumFrameCount = 100_000;
public const int MaximumImageCount = 100;
public const int MaximumMipmapCount = 32;
public const int MaximumMipmapByteCount = 250_000_000; // 250 MB
}
}
4 changes: 0 additions & 4 deletions RePKG.Application/Texture/TexImageReader.cs
Original file line number Diff line number Diff line change
Expand Up @@ -111,10 +111,6 @@ private byte[] ReadBytes(BinaryReader reader)
if (reader.BaseStream.Position + byteCount > reader.BaseStream.Length)
throw new UnsafeTexException("Detected invalid mipmap byte count - exceeds stream length");

if (byteCount > Constants.MaximumMipmapByteCount)
throw new UnsafeTexException(
$"Mipmap byte count exceeds maximum size: {byteCount}/{Constants.MaximumMipmapByteCount}");

if (!ReadMipmapBytes)
{
reader.BaseStream.Seek(byteCount, SeekOrigin.Current);
Expand Down