Added note about checking dwi chart length of at least 2 characters

This commit is contained in:
Michael Votaw
2025-04-30 10:48:35 -05:00
committed by teejusb
parent 977f83a16f
commit b7bafbef93
+4 -2
View File
@@ -437,10 +437,12 @@ static bool LoadFromDWITokens(
{
CHECKPOINT_M( "DWILoader::LoadFromDWITokens()" );
// If there's no step data to load for this chart, bail out here, instead of letting
// SetNoteData() throw an assertion.
// If the step data isn't at least 2 characters long, ParseNoteData() runs the risk
// of trying to read past the end of the string.
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;
}