Commit 8d12efec authored by Alexandre Julliard's avatar Alexandre Julliard

dmloader: Check for invalid class in EnableCache().

Fixes a test failure with sone Mingw versions. Signed-off-by: 's avatarAlexandre Julliard <julliard@winehq.org>
parent f779f36d
...@@ -771,10 +771,12 @@ static HRESULT WINAPI IDirectMusicLoaderImpl_EnableCache(IDirectMusicLoader8 *if ...@@ -771,10 +771,12 @@ static HRESULT WINAPI IDirectMusicLoaderImpl_EnableCache(IDirectMusicLoader8 *if
if (IsEqualGUID(class, &GUID_DirectMusicAllTypes)) if (IsEqualGUID(class, &GUID_DirectMusicAllTypes))
This->cache_class = enable ? ~0 : 0; This->cache_class = enable ? ~0 : 0;
else { else {
int idx = index_from_class(class);
if (idx == -1) return S_FALSE;
if (enable) if (enable)
This->cache_class |= 1 << index_from_class(class); This->cache_class |= 1 << idx;
else else
This->cache_class &= ~(1 << index_from_class(class)); This->cache_class &= ~(1 << idx);
} }
if (!enable) if (!enable)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment