Bail out earlier when dealing with certain types of malformed DWI charts.

This commit is contained in:
Michael Votaw
2025-05-10 09:22:01 -07:00
committed by teejusb
parent 398a7062ea
commit 977f83a16f
+7
View File
@@ -437,6 +437,13 @@ static bool LoadFromDWITokens(
{ {
CHECKPOINT_M( "DWILoader::LoadFromDWITokens()" ); 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); out.m_StepsType = GetTypeFromMode(sMode);
// if the meter is empty, force it to 1. // if the meter is empty, force it to 1.