gdiplus: Avoid using PathToRegion with an empty path.

Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Alexandre Julliard 2016-06-16 00:36:37 +09:00
parent e0f3f020c0
commit bc44b3f60d
1 changed files with 6 additions and 0 deletions

View File

@ -1114,6 +1114,12 @@ static GpStatus get_path_hrgn(GpPath *path, GpGraphics *graphics, HRGN *hrgn)
GpStatus stat;
INT save_state;
if (!path->pathdata.Count) /* PathToRegion doesn't support empty paths */
{
*hrgn = CreateRectRgn( 0, 0, 0, 0 );
return *hrgn ? Ok : OutOfMemory;
}
if (!graphics)
{
new_hdc = CreateCompatibleDC(0);