dplayx: Prevent out-of-bounds access to lpMemArea.
Based on a patch by Andrey Gusev. Signed-off-by: Huw Davies <huw@codeweavers.com> Signed-off-by: Alistair Leslie-Hughes <leslie_alistair@hotmail.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
8d0444826d
commit
18e532d645
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue