Bugfix T41133: Audio: Speakers with animated pitch cause clicks in rendered animations, crashes or huge filesizes in rendered audio

Crash happened when the pitch value got <= 0, preventing this now.
This commit is contained in:
Joerg Mueller 2014-07-21 14:24:37 +02:00
parent 25fab54e09
commit 31e1a31fee
2 changed files with 4 additions and 0 deletions

View File

@ -48,5 +48,7 @@ float AUD_PitchReader::getPitch() const
void AUD_PitchReader::setPitch(float pitch)
{
if(pitch <= 0)
pitch = 1;
m_pitch = pitch;
}

View File

@ -422,6 +422,8 @@ bool AUD_SoftwareDevice::AUD_SoftwareHandle::setPitch(float pitch)
{
if(!m_status)
return false;
if(pitch <= 0)
pitch = 1;
m_user_pitch = pitch;
return true;
}