Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
d58d9902
Commit
d58d9902
authored
Jul 31, 2023
by
David Kahurani
Committed by
Alexandre Julliard
Aug 01, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gdiplus: Reject zero-width/zero-height rectangles.
Wine-Bug:
https://bugs.winehq.org/show_bug.cgi?id=55351
Signed-off-by:
David Kahurani
<
k.kahurani@gmail.com
>
parent
99f0d3d7
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
24 additions
and
23 deletions
+24
-23
graphicspath.c
dlls/gdiplus/graphicspath.c
+10
-10
graphicspath.c
dlls/gdiplus/tests/graphicspath.c
+14
-13
No files found.
dlls/gdiplus/graphicspath.c
View file @
d58d9902
...
...
@@ -283,10 +283,10 @@ static GpStatus extend_current_figure(GpPath *path, GDIPCONST PointF *points, IN
*
* PARAMS
* path [I/O] Path that the arc is appended to
* x
1 [I] X coordinate of the boundary box
* y
1 [I] Y coordinate of the boundary box
*
x2 [I] Width of the boundary box
*
y2 [I] Height of the boundary box
* x
[I] X coordinate of the boundary rectangle
* y
[I] Y coordinate of the boundary rectangle
*
width [I] Width of the boundary rectangle
*
height [I] Height of the boundary rectangle
* startAngle [I] Starting angle of the arc, clockwise
* sweepAngle [I] Angle of the arc, clockwise
*
...
...
@@ -302,20 +302,20 @@ static GpStatus extend_current_figure(GpPath *path, GDIPCONST PointF *points, IN
* In both cases, the value of newfigure of the given path is FALSE
* afterwards.
*/
GpStatus
WINGDIPAPI
GdipAddPathArc
(
GpPath
*
path
,
REAL
x
1
,
REAL
y1
,
REAL
x2
,
REAL
y2
,
REAL
startAngle
,
REAL
sweepAngle
)
GpStatus
WINGDIPAPI
GdipAddPathArc
(
GpPath
*
path
,
REAL
x
,
REAL
y
,
REAL
width
,
REAL
height
,
REAL
startAngle
,
REAL
sweepAngle
)
{
GpPointF
*
points
;
GpStatus
status
;
INT
count
;
TRACE
(
"(%p, %.2f, %.2f, %.2f, %.2f, %.2f, %.2f)
\n
"
,
path
,
x
1
,
y1
,
x2
,
y2
,
startAngle
,
sweepAngle
);
path
,
x
,
y
,
width
,
height
,
startAngle
,
sweepAngle
);
if
(
!
path
)
if
(
!
path
||
width
<=
0
.
0
f
||
height
<=
0
.
0
f
)
return
InvalidParameter
;
count
=
arc2polybezier
(
NULL
,
x
1
,
y1
,
x2
,
y2
,
startAngle
,
sweepAngle
);
count
=
arc2polybezier
(
NULL
,
x
,
y
,
width
,
height
,
startAngle
,
sweepAngle
);
if
(
count
==
0
)
return
Ok
;
...
...
@@ -323,7 +323,7 @@ GpStatus WINGDIPAPI GdipAddPathArc(GpPath *path, REAL x1, REAL y1, REAL x2,
if
(
!
points
)
return
OutOfMemory
;
arc2polybezier
(
points
,
x
1
,
y1
,
x2
,
y2
,
startAngle
,
sweepAngle
);
arc2polybezier
(
points
,
x
,
y
,
width
,
height
,
startAngle
,
sweepAngle
);
status
=
extend_current_figure
(
path
,
points
,
count
,
PathPointTypeBezier
);
...
...
dlls/gdiplus/tests/graphicspath.c
View file @
d58d9902
...
...
@@ -451,6 +451,20 @@ static void test_arc(void)
GpPath
*
path
;
GdipCreatePath
(
FillModeAlternate
,
&
path
);
status
=
GdipAddPathArc
(
path
,
100
.
0
,
100
.
0
,
1
.
0
,
0
.
0
,
0
.
0
,
90
.
0
);
expect
(
InvalidParameter
,
status
);
status
=
GdipAddPathArc
(
path
,
100
.
0
,
100
.
0
,
0
.
0
,
1
.
0
,
0
.
0
,
90
.
0
);
expect
(
InvalidParameter
,
status
);
status
=
GdipAddPathArc
(
path
,
100
.
0
,
100
.
0
,
-
40
,
1
.
0
,
0
.
0
,
90
.
0
);
expect
(
InvalidParameter
,
status
);
status
=
GdipAddPathArc
(
path
,
100
.
0
,
100
.
0
,
1
.
0
,
-
50
.
0
,
0
.
0
,
90
.
0
);
expect
(
InvalidParameter
,
status
);
GdipResetPath
(
path
);
/* Exactly 90 degrees */
status
=
GdipAddPathArc
(
path
,
100
.
0
,
100
.
0
,
500
.
0
,
700
.
0
,
0
.
0
,
90
.
0
);
expect
(
Ok
,
status
);
...
...
@@ -1264,20 +1278,7 @@ static void test_flatten2(void)
expect
(
Ok
,
status
);
/* path seen in the wild that caused a stack overflow */
status
=
GdipAddPathArc
(
path
,
-
136
.
33
,
20
.
00
,
786
.
00
,
786
.
00
,
-
105
.
00
,
30
.
00
);
expect
(
Ok
,
status
);
status
=
GdipAddPathArc
(
path
,
256
.
67
,
413
.
00
,
0
.
00
,
0
.
00
,
-
75
.
00
,
-
30
.
00
);
expect
(
Ok
,
status
);
status
=
GdipClosePathFigure
(
path
);
expect
(
Ok
,
status
);
status
=
GdipFlattenPath
(
path
,
NULL
,
1
.
0
);
expect
(
Ok
,
status
);
/* path seen in the wild that caused a stack overflow */
/* same path but redo with the manual points that caused a crash */
status
=
GdipResetPath
(
path
);
expect
(
Ok
,
status
);
status
=
GdipAddPathBezier
(
path
,
154
.
950806
,
33
.
391144
,
221
.
586075
,
15
.
536285
,
291
.
747314
,
15
.
536285
,
358
.
382568
,
33
.
391144
);
expect
(
Ok
,
status
);
status
=
GdipAddPathBezier
(
path
,
256
.
666809
,
412
.
999512
,
256
.
666718
,
412
.
999481
,
256
.
666656
,
412
.
999481
,
256
.
666565
,
412
.
999512
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment