From 19f638da5ac187ba17787c1a8d456642b024a297 Mon Sep 17 00:00:00 2001 From: Ross Bencina Date: Thu, 1 Oct 2020 14:08:39 +1000 Subject: [PATCH] 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. --- src/hostapi/wdmks/pa_win_wdmks.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/hostapi/wdmks/pa_win_wdmks.c b/src/hostapi/wdmks/pa_win_wdmks.c index 70a48d8ff..2403ed52a 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)