From 7e2a33c875c6b2b53a8925959496cc698765621f Mon Sep 17 00:00:00 2001 From: Colin McEwan Date: Thu, 19 Nov 2020 02:22:22 +0000 Subject: [PATCH] Fix crashes on disconnected pins in wmdks topologies. (#300) * Fix crashes on disconnected pins in wmdks topologies. * Fix potential assert on disconnected physical output pin in PinNew --- src/hostapi/wdmks/pa_win_wdmks.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/hostapi/wdmks/pa_win_wdmks.c b/src/hostapi/wdmks/pa_win_wdmks.c index 2403ed5..15ba438 100644 --- a/src/hostapi/wdmks/pa_win_wdmks.c +++ b/src/hostapi/wdmks/pa_win_wdmks.c @@ -1057,8 +1057,9 @@ static const KSTOPOLOGY_CONNECTION* FindStartConnectionFrom(ULONG startPin, PaWi } } + /* Some devices may report topologies that leave pins unconnected. This may be by design or driver installation + issues. Pass the error condition back to caller. */ PA_DEBUG(("FindStartConnectionFrom: returning NULL\n")); - assert(FALSE); return 0; } @@ -1077,8 +1078,8 @@ static const KSTOPOLOGY_CONNECTION* FindStartConnectionTo(ULONG startPin, PaWinW } } + /* Unconnected pin. Inform caller. */ PA_DEBUG(("FindStartConnectionTo: returning NULL\n")); - assert(FALSE); return 0; } @@ -1970,8 +1971,8 @@ static PaWinWdmPin* PinNew(PaWinWdmFilter* parentFilter, unsigned long pinId, Pa } else { - /* Should never come here! */ - assert(FALSE); + /* Unconnected pin */ + goto error; } } } -- 2.43.0