GetDeviceCaps: make sure the devCaps field is not NULL before

dereferencing it.
oldstable
Francois Gouget 2001-04-09 18:34:10 +00:00 committed by Alexandre Julliard
parent 40af1a87a5
commit 4f44845da3
1 changed files with 5 additions and 2 deletions

View File

@ -841,9 +841,12 @@ INT WINAPI GetDeviceCaps( HDC hdc, INT cap )
hdc,cap );
if ((dc = DC_GetDCPtr( hdc )))
{
ret = *(WORD *)(((char *)dc->devCaps) + cap);
if (dc->devCaps)
{
ret = *(WORD *)(((char *)dc->devCaps) + cap);
if ((cap == NUMCOLORS) && (ret == 0xffff)) ret = -1;
}
GDI_ReleaseObj( hdc );
if ((cap == NUMCOLORS) && (ret == 0xffff)) ret = -1;
}
break;
}