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
c65de047
Commit
c65de047
authored
Feb 24, 2012
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gdi32: Use 64-bit values when computing ellipses to avoid overflows.
parent
67a0db3c
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
12 deletions
+13
-12
graphics.c
dlls/gdi32/dibdrv/graphics.c
+6
-6
region.c
dlls/gdi32/region.c
+7
-6
No files found.
dlls/gdi32/dibdrv/graphics.c
View file @
c65de047
...
...
@@ -78,11 +78,11 @@ static int ellipse_first_quadrant( int width, int height, POINT *data )
{
const
int
a
=
width
-
1
;
const
int
b
=
height
-
1
;
const
int
asq
=
8
*
a
*
a
;
const
int
bsq
=
8
*
b
*
b
;
int
dx
=
4
*
b
*
b
*
(
1
-
a
);
int
dy
=
4
*
a
*
a
*
(
1
+
(
b
%
2
));
int
err
=
dx
+
dy
+
a
*
a
*
(
b
%
2
);
const
INT64
asq
=
(
INT64
)
8
*
a
*
a
;
const
INT64
bsq
=
(
INT64
)
8
*
b
*
b
;
INT64
dx
=
(
INT64
)
4
*
b
*
b
*
(
1
-
a
);
INT64
dy
=
(
INT64
)
4
*
a
*
a
*
(
1
+
(
b
%
2
));
INT64
err
=
dx
+
dy
+
a
*
a
*
(
b
%
2
);
int
pos
=
0
;
POINT
pt
;
...
...
@@ -93,7 +93,7 @@ static int ellipse_first_quadrant( int width, int height, POINT *data )
while
(
pt
.
x
>=
width
/
2
)
{
int
e2
=
2
*
err
;
INT64
e2
=
2
*
err
;
data
[
pos
++
]
=
pt
;
if
(
e2
>=
dx
)
{
...
...
dlls/gdi32/region.c
View file @
c65de047
...
...
@@ -754,7 +754,8 @@ HRGN WINAPI CreateRoundRectRgn( INT left, INT top,
{
RGNOBJ
*
obj
;
HRGN
hrgn
=
0
;
int
a
,
b
,
i
,
x
,
y
,
asq
,
bsq
,
dx
,
dy
,
err
;
int
a
,
b
,
i
,
x
,
y
;
INT64
asq
,
bsq
,
dx
,
dy
,
err
;
RECT
*
rects
;
/* Make the dimensions sensible */
...
...
@@ -788,10 +789,10 @@ HRGN WINAPI CreateRoundRectRgn( INT left, INT top,
a
=
ellipse_width
-
1
;
b
=
ellipse_height
-
1
;
asq
=
8
*
a
*
a
;
bsq
=
8
*
b
*
b
;
dx
=
4
*
b
*
b
*
(
1
-
a
);
dy
=
4
*
a
*
a
*
(
1
+
(
b
%
2
));
asq
=
(
INT64
)
8
*
a
*
a
;
bsq
=
(
INT64
)
8
*
b
*
b
;
dx
=
(
INT64
)
4
*
b
*
b
*
(
1
-
a
);
dy
=
(
INT64
)
4
*
a
*
a
*
(
1
+
(
b
%
2
));
err
=
dx
+
dy
+
a
*
a
*
(
b
%
2
);
x
=
0
;
...
...
@@ -802,7 +803,7 @@ HRGN WINAPI CreateRoundRectRgn( INT left, INT top,
while
(
x
<=
ellipse_width
/
2
)
{
int
e2
=
2
*
err
;
INT64
e2
=
2
*
err
;
if
(
e2
>=
dx
)
{
x
++
;
...
...
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