add sanity check

This commit is contained in:
Glenn Maynard
2002-09-08 22:02:01 +00:00
parent 8cbbd628f3
commit 76e1a946c7
+4
View File
@@ -337,6 +337,10 @@ bool DWILoader::LoadFromDWIFile( CString sPath, Song &out )
{
CStringArray arrayBPMChangeValues;
split( arrayBPMChangeExpressions[b], "=", arrayBPMChangeValues );
if(arrayBPMChangeValues.GetSize() != 2) {
LOG->Warn( "Invalid CHANGEBPM: \"%s\"", arrayBPMChangeExpressions[b]);
continue;
}
float fIndex = atoi( arrayBPMChangeValues[0] ) * ROWS_PER_BEAT / 4.0f;
float fBeat = NoteRowToBeat( fIndex );
float fNewBPM = (float)atof( arrayBPMChangeValues[1] );