mirror of
https://github.com/libretro/ppsspp.git
synced 2024-11-27 18:30:56 +00:00
Clamp bad audio pitches for safety.
This commit is contained in:
parent
dd667156f5
commit
a530d47fcd
@ -256,6 +256,15 @@ u32 sceSasSetPitch(u32 core, int voiceNum, int pitch) {
|
||||
}
|
||||
|
||||
SasVoice &v = sas->voices[voiceNum];
|
||||
// Clamp pitch
|
||||
if (pitch < PSP_SAS_PITCH_MIN) {
|
||||
WARN_LOG(SAS, "bad pitch %i, clamping to %i", pitch, PSP_SAS_PITCH_MIN);
|
||||
pitch = PSP_SAS_PITCH_MIN;
|
||||
} else if (pitch > PSP_SAS_PITCH_MAX) {
|
||||
WARN_LOG(SAS, "bad pitch %i, clamping to %i", pitch, PSP_SAS_PITCH_MAX);
|
||||
pitch = PSP_SAS_PITCH_MAX;
|
||||
}
|
||||
|
||||
v.pitch = pitch;
|
||||
v.ChangedParams(false);
|
||||
return 0;
|
||||
|
Loading…
Reference in New Issue
Block a user