From bc44b3f60d3df213f3a55d6f0878c019932bebfd Mon Sep 17 00:00:00 2001 From: Alexandre Julliard Date: Thu, 16 Jun 2016 00:36:37 +0900 Subject: [PATCH] gdiplus: Avoid using PathToRegion with an empty path. Signed-off-by: Alexandre Julliard --- dlls/gdiplus/region.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/dlls/gdiplus/region.c b/dlls/gdiplus/region.c index a0c0823ef68..50cb46aeb7a 100644 --- a/dlls/gdiplus/region.c +++ b/dlls/gdiplus/region.c @@ -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);