Commit 18e532d6 authored by Huw Davies's avatar Huw Davies Committed by Alexandre Julliard

dplayx: Prevent out-of-bounds access to lpMemArea.

Based on a patch by Andrey Gusev. Signed-off-by: 's avatarHuw Davies <huw@codeweavers.com> Signed-off-by: 's avatarAlistair Leslie-Hughes <leslie_alistair@hotmail.com> Signed-off-by: 's avatarAlexandre Julliard <julliard@winehq.org>
parent 8d044482
......@@ -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;
......
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