From 977f83a16f2d7be83f92a56bd6d41c1761d16066 Mon Sep 17 00:00:00 2001 From: Michael Votaw Date: Sat, 19 Apr 2025 20:10:28 -0500 Subject: [PATCH] Bail out earlier when dealing with certain types of malformed DWI charts. --- src/NotesLoaderDWI.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/NotesLoaderDWI.cpp b/src/NotesLoaderDWI.cpp index b1c1a36961..7589546973 100644 --- a/src/NotesLoaderDWI.cpp +++ b/src/NotesLoaderDWI.cpp @@ -436,7 +436,14 @@ static bool LoadFromDWITokens( const RString &sPath ) { CHECKPOINT_M( "DWILoader::LoadFromDWITokens()" ); - + + if (sStepData1.size() < 2 && sStepData2.size() < 2) + { + // If there's no step data to load for this chart, bail out here, instead of letting + // SetNoteData() throw an assertion. + LOG->Warn("Song file \"%s\" has malformed chart data for chart %s:%s:%s. Skipping chart.", sPath.c_str(), sMode.c_str(), sDescription.c_str(), sNumFeet.c_str()); + return false; + } out.m_StepsType = GetTypeFromMode(sMode); // if the meter is empty, force it to 1.