Fixes: caa41d4917a84dbbeb4aa14f18cfecfd17efe71a Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=49659 Signed-off-by: Zebediah Figura z.figura12@gmail.com --- dlls/msdmo/dmoreg.c | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-)
diff --git a/dlls/msdmo/dmoreg.c b/dlls/msdmo/dmoreg.c index 8e0680931f4..4d8f35554fd 100644 --- a/dlls/msdmo/dmoreg.c +++ b/dlls/msdmo/dmoreg.c @@ -528,10 +528,12 @@ static HRESULT WINAPI IEnumDMO_fnNext( { DWORD size = types_size, i;
- while ((ret = RegQueryValueExW(hkey, L"InputTypes", NULL, NULL, - (BYTE *)types, &size)) == ERROR_MORE_DATA) + for (;;) { - if (!array_reserve((void **)&types, &types_size, size, 1)) + ret = RegQueryValueExW(hkey, L"InputTypes", NULL, NULL, (BYTE *)types, &size); + if (ret != ERROR_SUCCESS && ret != ERROR_MORE_DATA) + break; + if (size > types_size && !array_reserve((void **)&types, &types_size, size, 1)) { RegCloseKey(hkey); free(types); @@ -559,10 +561,12 @@ static HRESULT WINAPI IEnumDMO_fnNext( { DWORD size = types_size, i;
- while ((ret = RegQueryValueExW(hkey, L"OutputTypes", NULL, NULL, - (BYTE *)types, &size)) == ERROR_MORE_DATA) + for (;;) { - if (!array_reserve((void **)&types, &types_size, size, 1)) + ret = RegQueryValueExW(hkey, L"InputTypes", NULL, NULL, (BYTE *)types, &size); + if (ret != ERROR_SUCCESS && ret != ERROR_MORE_DATA) + break; + if (size > types_size && !array_reserve((void **)&types, &types_size, size, 1)) { RegCloseKey(hkey); free(types);