From 4aee9ba5ad1c7df34a06fe2bbe39ae33fd8ffcee Mon Sep 17 00:00:00 2001 From: Alistair Leslie-Hughes Date: Fri, 22 Nov 2019 08:22:35 +0000 Subject: [PATCH] dmloader: Stop after find first matching object. This stops a crash in Legoland on startup when finding cached objects. Placing a break in each of the if's causes the wrong object to be loaded. The help states it looks at each type in order. So, we might have to loop the cache multiple times to ensure that when an object has flag DMUS_OBJ_OBJECT, it's preferred over a DMUS_OBJ_FILENAME | DMUS_OBJ_FULLPATH match. Signed-off-by: Alistair Leslie-Hughes Signed-off-by: Michael Stefaniuc Signed-off-by: Alexandre Julliard --- dlls/dmloader/loader.c | 1 + 1 file changed, 1 insertion(+) diff --git a/dlls/dmloader/loader.c b/dlls/dmloader/loader.c index 0da8323e7e5..69a438765d5 100644 --- a/dlls/dmloader/loader.c +++ b/dlls/dmloader/loader.c @@ -208,6 +208,7 @@ static HRESULT WINAPI IDirectMusicLoaderImpl_GetObject(IDirectMusicLoader8 *ifac TRACE(": not loaded yet\n"); pObjectEntry = pExistingEntry; } + break; } else if ((pDesc->dwValidData & (DMUS_OBJ_FILENAME | DMUS_OBJ_FULLPATH)) && (pExistingEntry->Desc.dwValidData & (DMUS_OBJ_FILENAME | DMUS_OBJ_FULLPATH)) &&