Fixes: caa41d4917a84dbbeb4aa14f18cfecfd17efe71a Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=49659 Signed-off-by: Zebediah Figura z.figura12@gmail.com --- v2: actually break out of the loop...
dlls/msdmo/dmoreg.c | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-)
diff --git a/dlls/msdmo/dmoreg.c b/dlls/msdmo/dmoreg.c index 8e0680931f4..3047dfd167f 100644 --- a/dlls/msdmo/dmoreg.c +++ b/dlls/msdmo/dmoreg.c @@ -526,11 +526,16 @@ static HRESULT WINAPI IEnumDMO_fnNext(
if (This->pInTypes) { - DWORD size = types_size, i; + DWORD size, i;
- while ((ret = RegQueryValueExW(hkey, L"InputTypes", NULL, NULL, - (BYTE *)types, &size)) == ERROR_MORE_DATA) + for (;;) { + size = types_size; + ret = RegQueryValueExW(hkey, L"InputTypes", NULL, NULL, (BYTE *)types, &size); + if (ret != ERROR_SUCCESS && ret != ERROR_MORE_DATA) + break; + if (size >= types_size) + break; if (!array_reserve((void **)&types, &types_size, size, 1)) { RegCloseKey(hkey); @@ -559,9 +564,14 @@ 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 (;;) { + size = types_size; + ret = RegQueryValueExW(hkey, L"OutputTypes", NULL, NULL, (BYTE *)types, &size); + if (ret != ERROR_SUCCESS && ret != ERROR_MORE_DATA) + break; + if (size >= types_size) + break; if (!array_reserve((void **)&types, &types_size, size, 1)) { RegCloseKey(hkey);