[1/2] winepulse: Avoid 32-bit calculation with 64-bit result (Coverity)

André Hentschel nerv at dawncrow.de
Mon Nov 16 15:36:00 CST 2015


Signed-off-by: André Hentschel <nerv at dawncrow.de>
---
CID 1339389

 dlls/winepulse.drv/mmdevdrv.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/dlls/winepulse.drv/mmdevdrv.c b/dlls/winepulse.drv/mmdevdrv.c
index b2f83c8..7369802 100644
--- a/dlls/winepulse.drv/mmdevdrv.c
+++ b/dlls/winepulse.drv/mmdevdrv.c
@@ -2239,10 +2239,9 @@ static HRESULT WINAPI AudioClock_GetFrequency(IAudioClock *iface, UINT64 *freq)
     pthread_mutex_lock(&pulse_lock);
     hr = pulse_stream_valid(This);
     if (SUCCEEDED(hr)) {
+        *freq = This->ss.rate;
         if (This->share == AUDCLNT_SHAREMODE_SHARED)
-            *freq = This->ss.rate * pa_frame_size(&This->ss);
-        else
-            *freq = This->ss.rate;
+            *freq *= pa_frame_size(&This->ss);
     }
     pthread_mutex_unlock(&pulse_lock);
     return hr;
-- 
1.9.1





More information about the wine-patches mailing list