[PATCH] quartz: avoid endless loop (Coverity)

Marcus Meissner marcus at jet.franken.de
Sat Oct 31 04:43:25 CDT 2015


713018 Logically dead code

if we have no adapter supporting this format we would go in
an endless loop.

The code still needs to be different, but at least the endless
loop is now gone.

Signed-off-by: Marcus Meissner <marcus at jet.franken.de>
---
 dlls/quartz/vmr9.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/dlls/quartz/vmr9.c b/dlls/quartz/vmr9.c
index 10b9dff..3538ddb 100644
--- a/dlls/quartz/vmr9.c
+++ b/dlls/quartz/vmr9.c
@@ -3085,6 +3085,7 @@ static HRESULT VMR9DefaultAllocatorPresenterImpl_create(struct quartz_vmr *paren
         D3DDISPLAYMODE mode;
 
         hr = IDirect3D9_EnumAdapterModes(This->d3d9_ptr, i++, D3DFMT_X8R8G8B8, 0, &mode);
+	if (hr == D3DERR_INVALIDCALL) break; /* out of adapters */
     } while (FAILED(hr));
     if (FAILED(hr))
         ERR("HR: %08x\n", hr);
-- 
2.6.2




More information about the wine-patches mailing list