From 3f573fa74f2fd1ec820b9fad7989f1596639ac06 Mon Sep 17 00:00:00 2001 From: KibbeWater <35224538+KibbeWater@users.noreply.github.com> Date: Sat, 17 Jan 2026 19:19:46 +0100 Subject: [PATCH] fix: remove reduntant mipmap filesize limits --- RePKG.Application/Constants.cs | 1 - RePKG.Application/Texture/TexImageReader.cs | 4 ---- 2 files changed, 5 deletions(-) diff --git a/RePKG.Application/Constants.cs b/RePKG.Application/Constants.cs index 225bdb2..92019ca 100644 --- a/RePKG.Application/Constants.cs +++ b/RePKG.Application/Constants.cs @@ -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 } } \ No newline at end of file diff --git a/RePKG.Application/Texture/TexImageReader.cs b/RePKG.Application/Texture/TexImageReader.cs index 7c5fa5e..5f51f84 100644 --- a/RePKG.Application/Texture/TexImageReader.cs +++ b/RePKG.Application/Texture/TexImageReader.cs @@ -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);