mmdevapi: Skip device if GetId fails (Coverity)

André Hentschel nerv at dawncrow.de
Tue Dec 22 12:35:02 CST 2015


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

 dlls/mmdevapi/devenum.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/dlls/mmdevapi/devenum.c b/dlls/mmdevapi/devenum.c
index d50d206..5f0ffba 100644
--- a/dlls/mmdevapi/devenum.c
+++ b/dlls/mmdevapi/devenum.c
@@ -1065,9 +1065,11 @@ static HRESULT WINAPI MMDevEnum_GetDevice(IMMDeviceEnumerator *iface, const WCHA
 
     for (i = 0; i < MMDevice_count; ++i)
     {
+        HRESULT hr;
         WCHAR *str;
         dev = &MMDevice_head[i]->IMMDevice_iface;
-        IMMDevice_GetId(dev, &str);
+        hr = IMMDevice_GetId(dev, &str);
+        if (FAILED(hr)) continue;
 
         if (str && !lstrcmpW(str, name))
         {
-- 
1.9.1





More information about the wine-patches mailing list