From: Ross Bencina Date: Thu, 1 Oct 2020 04:08:39 +0000 (+1000) Subject: wdmks: ensure that pins that failed creation by PinNew() are set to NULL. Note that... X-Git-Tag: v19.7.0~106 X-Git-Url: https://andrewgundersen.net/repos?a=commitdiff_plain;h=19f638da5ac187ba17787c1a8d456642b024a297;p=portaudio wdmks: ensure that pins that failed creation by PinNew() are set to NULL. Note that PaUtil_AllocateMemory currently calls GlobalAlloc without the GMEM_ZEROINIT flag, so there was no guarantee that filter->pins[pinId] was zero. --- diff --git a/src/hostapi/wdmks/pa_win_wdmks.c b/src/hostapi/wdmks/pa_win_wdmks.c index 70a48d8..2403ed5 100644 --- a/src/hostapi/wdmks/pa_win_wdmks.c +++ b/src/hostapi/wdmks/pa_win_wdmks.c @@ -2844,6 +2844,10 @@ PaError FilterInitializePins( PaWinWdmFilter* filter ) filter->pins[pinId] = newPin; ++filter->validPinCount; } + else + { + filter->pins[pinId] = 0; + } } if (filter->validPinCount == 0)