Fix some memory access issues

This commit is contained in:
Daniel Winzen
2014-12-26 19:06:03 +01:00
parent 21bd57b629
commit 011dee2564
2 changed files with 3 additions and 3 deletions

View File

@@ -867,7 +867,7 @@ void AutomationPattern::generateTangents()
void AutomationPattern::generateTangents( timeMap::const_iterator it,
int numToGenerate )
{
if( m_timeMap.size() < 2 )
if( m_timeMap.size() < 2 && numToGenerate > 0 )
{
m_tangents[it.key()] = 0;
return;

View File

@@ -446,14 +446,14 @@ void EnvelopeAndLfoParameters::updateSampleVars()
{
sample_t * tmp = m_pahdEnv;
m_pahdEnv = new sample_t[m_pahdFrames];
delete tmp;
delete[] tmp;
m_pahdBufSize = m_pahdFrames;
}
if( m_rBufSize < m_rFrames )
{
sample_t * tmp = m_rEnv;
m_rEnv = new sample_t[m_rFrames];
delete tmp;
delete[] tmp;
m_rBufSize = m_rFrames;
}