From: Aida JonikienÄ— aidas957@gmail.com
GTA San Andreas calls this function with NaN positions under certain circumstances which eventually results in dwTotalAmpFactor value being really high (and causing extremely loud audio output). --- dlls/dsound/sound3d.c | 5 +++++ 1 file changed, 5 insertions(+)
diff --git a/dlls/dsound/sound3d.c b/dlls/dsound/sound3d.c index 2ee80a647d9..faa7552cc3c 100644 --- a/dlls/dsound/sound3d.c +++ b/dlls/dsound/sound3d.c @@ -964,6 +964,11 @@ static HRESULT WINAPI IDirectSound3DListenerImpl_SetOrientation(IDirectSound3DLi
TRACE("setting: Front vector = (%f,%f,%f); Top vector = (%f,%f,%f); dwApply = %ld\n", xFront, yFront, zFront, xTop, yTop, zTop, dwApply); + + if (isnan(xFront) || isnan(yFront) || isnan(zFront) + || isnan(xTop) || isnan(yTop) || isnan(zTop)) + return DSERR_INVALIDPARAM; + This->device->ds3dl.vOrientFront.x = xFront; This->device->ds3dl.vOrientFront.y = yFront; This->device->ds3dl.vOrientFront.z = zFront;