Jeff Smith : gdiplus: Each pen dash array element must be greater than zero.
Alexandre Julliard
julliard at winehq.org
Mon Feb 17 15:42:16 CST 2020
Module: wine
Branch: master
Commit: ffd4bb25206abd6fc65db903f3cf6a0ba8efadd5
URL: https://source.winehq.org/git/wine.git/?a=commit;h=ffd4bb25206abd6fc65db903f3cf6a0ba8efadd5
Author: Jeff Smith <whydoubt at gmail.com>
Date: Sat Feb 15 15:51:37 2020 -0600
gdiplus: Each pen dash array element must be greater than zero.
Signed-off-by: Jeff Smith <whydoubt at gmail.com>
Signed-off-by: Vincent Povirk <vincent at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
---
dlls/gdiplus/pen.c | 5 +----
dlls/gdiplus/tests/pen.c | 7 +++++--
2 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/dlls/gdiplus/pen.c b/dlls/gdiplus/pen.c
index 8bcb91819a..156f90a19d 100644
--- a/dlls/gdiplus/pen.c
+++ b/dlls/gdiplus/pen.c
@@ -598,13 +598,10 @@ GpStatus WINGDIPAPI GdipSetPenDashArray(GpPen *pen, GDIPCONST REAL *dash,
for(i = 0; i < count; i++){
sum += dash[i];
- if(dash[i] < 0.0)
+ if(dash[i] <= 0.0)
return InvalidParameter;
}
- if(sum == 0.0 && count)
- return InvalidParameter;
-
heap_free(pen->dashes);
pen->dashes = NULL;
diff --git a/dlls/gdiplus/tests/pen.c b/dlls/gdiplus/tests/pen.c
index ceab92acff..28caf29acb 100644
--- a/dlls/gdiplus/tests/pen.c
+++ b/dlls/gdiplus/tests/pen.c
@@ -175,7 +175,7 @@ static void test_dasharray(void)
dashes[4] = 14.0;
dashes[5] = -100.0;
dashes[6] = -100.0;
- dashes[7] = dashes[8] = dashes[9] = dashes[10] = dashes[11] = 0.0;
+ dashes[7] = dashes[8] = dashes[9] = dashes[10] = dashes[11] = 1.0;
/* setting the array sets the type to custom */
GdipGetPenDashStyle(pen, &style);
@@ -218,10 +218,13 @@ static void test_dasharray(void)
/* Some invalid array values. */
status = GdipSetPenDashArray(pen, &dashes[7], 5);
- expect(InvalidParameter, status);
+ expect(Ok, status);
dashes[9] = -1.0;
status = GdipSetPenDashArray(pen, &dashes[7], 5);
expect(InvalidParameter, status);
+ dashes[9] = 0.0;
+ status = GdipSetPenDashArray(pen, &dashes[7], 5);
+ expect(InvalidParameter, status);
/* Try to set with count = 0. */
GdipSetPenDashStyle(pen, DashStyleDot);
More information about the wine-cvs
mailing list