From 39ca38849e178b1700c2556e71c128ee57fc648d Mon Sep 17 00:00:00 2001 From: Kurt Date: Mon, 16 Nov 2015 21:48:28 -0800 Subject: [PATCH] Fix possible memory overuse Mini detection would read all of the file in; no please no. Don't check for mini if above 10MB. --- pk3DS/Tools/ToolsUI.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pk3DS/Tools/ToolsUI.cs b/pk3DS/Tools/ToolsUI.cs index 1a18516..95a275e 100644 --- a/pk3DS/Tools/ToolsUI.cs +++ b/pk3DS/Tools/ToolsUI.cs @@ -91,7 +91,7 @@ private void openARC(string path, bool recursing = false) // Determine if it is a DARC or a Mini // Check if Mini first - string fx = CTR.mini.getIsMini(path); + string fx = fi.Length > 10 * (1<<20) ? null : CTR.mini.getIsMini(path); // no mini is above 10MB if (fx != null) // Is Mini Packed File { newFolder = folderPath + "_" + fx;