From a6ab4c51cfcceb592ff6225ca9d40a9fc4dc9b97 Mon Sep 17 00:00:00 2001 From: Maarten Lankhorst Date: Sun, 8 Jul 2007 16:38:05 +0200 Subject: [PATCH] dsound: Fix division by zero in DSOUND_Calc3DBuffer. --- dlls/dsound/sound3d.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/dlls/dsound/sound3d.c b/dlls/dsound/sound3d.c index cae1c280474..4a26947f26f 100644 --- a/dlls/dsound/sound3d.c +++ b/dlls/dsound/sound3d.c @@ -238,6 +238,9 @@ void DSOUND_Calc3DBuffer(IDirectSoundBufferImpl *dsb) /* my test show that for my way of calc., we need only half of angles */ DWORD dwInsideConeAngle = dsb->ds3db_ds3db.dwInsideConeAngle/2; DWORD dwOutsideConeAngle = dsb->ds3db_ds3db.dwOutsideConeAngle/2; + if (dwOutsideConeAngle == dwInsideConeAngle) + ++dwOutsideConeAngle; + /* full volume */ if (flAngle < dwInsideConeAngle) flAngle = dwInsideConeAngle;