Based on a patch by Andrey Gusev.
Signed-off-by: Huw Davies huw@codeweavers.com --- dlls/dplayx/dplayx_global.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/dlls/dplayx/dplayx_global.c b/dlls/dplayx/dplayx_global.c index 14c53a0c8d..bc087c8b33 100644 --- a/dlls/dplayx/dplayx_global.c +++ b/dlls/dplayx/dplayx_global.c @@ -120,9 +120,9 @@ static LPVOID DPLAYX_PrivHeapAlloc( DWORD flags, DWORD size )
/* Find blank area */ uBlockUsed = 0; - while( lpMemArea[ uBlockUsed ].used && uBlockUsed <= dwMaxBlock ) { uBlockUsed++; } + while( uBlockUsed < dwMaxBlock && lpMemArea[ uBlockUsed ].used ) { uBlockUsed++; }
- if( uBlockUsed <= dwMaxBlock ) + if( uBlockUsed < dwMaxBlock ) { /* Set the area used */ lpMemArea[ uBlockUsed ].used = TRUE;
Signed-off-by: Alistair Leslie-Hughes leslie_alistair@hotmail.commailto:leslie_alistair@hotmail.com