From f31e1f80e4b96001735fb7faad9a21014906643b Mon Sep 17 00:00:00 2001 From: Marcus Tomlinson Date: Sun, 27 Jan 2019 16:25:03 +0000 Subject: WASAPI: calloc stream buffers to ensure unused channels are left silent --- RtAudio.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'RtAudio.cpp') diff --git a/RtAudio.cpp b/RtAudio.cpp index 9927b26..babe13b 100644 --- a/RtAudio.cpp +++ b/RtAudio.cpp @@ -5191,8 +5191,8 @@ void RtApiWasapi::wasapiThread() } convBuffSize *= 2; // allow overflow for *SrRatio remainders - convBuffer = ( char* ) malloc( convBuffSize ); - stream_.deviceBuffer = ( char* ) malloc( deviceBuffSize ); + convBuffer = ( char* ) calloc( convBuffSize, 1 ); + stream_.deviceBuffer = ( char* ) calloc( deviceBuffSize, 1 ); if ( !convBuffer || !stream_.deviceBuffer ) { errorType = RtAudioError::MEMORY_ERROR; errorText = "RtApiWasapi::wasapiThread: Error allocating device buffer memory."; -- cgit v1.2.3