gdi32: Don't access DC in PolyDraw after releasing handle.

This commit is contained in:
Evan Stade 2007-07-03 19:06:34 -07:00 committed by Alexandre Julliard
parent c60c030c95
commit 53e05015f6
1 changed files with 13 additions and 8 deletions

View File

@ -833,18 +833,18 @@ BOOL WINAPI PolyDraw(HDC hdc, const POINT *lppt, const BYTE *lpbTypes,
if(dc->funcs->pPolyDraw) if(dc->funcs->pPolyDraw)
{ {
result = dc->funcs->pPolyDraw( dc->physDev, lppt, lpbTypes, cCount ); result = dc->funcs->pPolyDraw( dc->physDev, lppt, lpbTypes, cCount );
GDI_ReleaseObj( hdc ); goto end;
return result;
} }
GDI_ReleaseObj( hdc );
/* check for each bezierto if there are two more points */ /* check for each bezierto if there are two more points */
for( i = 0; i < cCount; i++ ) for( i = 0; i < cCount; i++ )
if( lpbTypes[i] != PT_MOVETO && if( lpbTypes[i] != PT_MOVETO &&
lpbTypes[i] & PT_BEZIERTO ) lpbTypes[i] & PT_BEZIERTO )
{ {
if( cCount < i+3 ) if( cCount < i+3 ){
return FALSE; result = FALSE;
goto end;
}
else else
i += 2; i += 2;
} }
@ -869,8 +869,10 @@ BOOL WINAPI PolyDraw(HDC hdc, const POINT *lppt, const BYTE *lpbTypes,
PolyBezierTo( hdc, &lppt[i], 3 ); PolyBezierTo( hdc, &lppt[i], 3 );
i += 2; i += 2;
} }
else else{
return FALSE; result = FALSE;
goto end;
}
if( lpbTypes[i] & PT_CLOSEFIGURE ) if( lpbTypes[i] & PT_CLOSEFIGURE )
{ {
@ -881,7 +883,10 @@ BOOL WINAPI PolyDraw(HDC hdc, const POINT *lppt, const BYTE *lpbTypes,
} }
} }
return TRUE; result = TRUE;
end:
GDI_ReleaseObj( hdc );
return result;
} }