Dmitry Timoshkov : gdiplus: Avoid a devision by zero when a being added segment length is 0.

Alexandre Julliard julliard at winehq.org
Mon Feb 18 13:27:05 CST 2013


Module: wine
Branch: master
Commit: 22a7458a3f5fdd060bc6ae9c26e5b98adcd6bc44
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=22a7458a3f5fdd060bc6ae9c26e5b98adcd6bc44

Author: Dmitry Timoshkov <dmitry at baikal.ru>
Date:   Mon Feb 18 17:32:12 2013 +0800

gdiplus: Avoid a devision by zero when a being added segment length is 0.

This sometimes happens after GdipAddPathLine + GdipWidenPath.

---

 dlls/gdiplus/graphicspath.c |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/dlls/gdiplus/graphicspath.c b/dlls/gdiplus/graphicspath.c
index 1fbebba..f4d1a4b 100644
--- a/dlls/gdiplus/graphicspath.c
+++ b/dlls/gdiplus/graphicspath.c
@@ -1702,6 +1702,13 @@ static void add_bevel_point(const GpPointF *endpoint, const GpPointF *nextpoint,
     REAL distance = pen->width/2.0;
     REAL bevel_dx, bevel_dy;
 
+    if (segment_length == 0.0)
+    {
+        *last_point = add_path_list_node(*last_point, endpoint->X,
+            endpoint->Y, PathPointTypeLine);
+        return;
+    }
+
     if (right_side)
     {
         bevel_dx = -distance * segment_dy / segment_length;




More information about the wine-cvs mailing list