FlpImport: fixed crash on invalid notes
Added a range check for channel parameter when adding notes. This fixes
a crash when for example importing the project posted on lmms-devel
by Andew Kelley lately.
(cherry picked from commit ee9d88e2d4)
This commit is contained in:
@@ -1310,7 +1310,14 @@ if( p.currentEffectChannel <= NumFxChannels )
|
||||
len /= (4*ppq) / DefaultTicksPerTact;
|
||||
note n( len, pos, key, vol * 100 / 128,
|
||||
pan*200 / 128 - 100 );
|
||||
if( ch < p.numChannels )
|
||||
{
|
||||
p.channels[ch].notes.push_back( qMakePair( p.currentPattern, n ) );
|
||||
}
|
||||
else
|
||||
{
|
||||
qDebug( "invalid " );
|
||||
}
|
||||
qDebug( "note: " );
|
||||
dump_mem( text+i*bpn, bpn );
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user