Commit 4f44845d authored by Francois Gouget's avatar Francois Gouget Committed by Alexandre Julliard

GetDeviceCaps: make sure the devCaps field is not NULL before

dereferencing it.
parent 40af1a87
...@@ -841,9 +841,12 @@ INT WINAPI GetDeviceCaps( HDC hdc, INT cap ) ...@@ -841,9 +841,12 @@ INT WINAPI GetDeviceCaps( HDC hdc, INT cap )
hdc,cap ); hdc,cap );
if ((dc = DC_GetDCPtr( hdc ))) 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 ); GDI_ReleaseObj( hdc );
if ((cap == NUMCOLORS) && (ret == 0xffff)) ret = -1;
} }
break; break;
} }
......
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