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
68ce9e92
Commit
68ce9e92
authored
Apr 17, 2010
by
Vincent Povirk
Committed by
Alexandre Julliard
Apr 19, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gdiplus: Prevent integer overflows when rounding text bounds.
Mono calls GdipMeasureString with a height so large that rounding and converting it to an integer gives a negative result.
parent
6b53cb27
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
3 deletions
+3
-3
graphics.c
dlls/gdiplus/graphics.c
+3
-3
No files found.
dlls/gdiplus/graphics.c
View file @
68ce9e92
...
@@ -3493,7 +3493,7 @@ static GpStatus gdip_format_string(GpGraphics *graphics,
...
@@ -3493,7 +3493,7 @@ static GpStatus gdip_format_string(GpGraphics *graphics,
gdip_format_string_callback
callback
,
void
*
user_data
)
gdip_format_string_callback
callback
,
void
*
user_data
)
{
{
WCHAR
*
stringdup
;
WCHAR
*
stringdup
;
INT
sum
=
0
,
height
=
0
,
fit
,
fitcpy
,
i
,
j
,
lret
,
nwidth
,
int
sum
=
0
,
height
=
0
,
fit
,
fitcpy
,
i
,
j
,
lret
,
nwidth
,
nheight
,
lineend
,
lineno
=
0
;
nheight
,
lineend
,
lineno
=
0
;
RectF
bounds
;
RectF
bounds
;
StringAlignment
halign
;
StringAlignment
halign
;
...
@@ -3508,8 +3508,8 @@ static GpStatus gdip_format_string(GpGraphics *graphics,
...
@@ -3508,8 +3508,8 @@ static GpStatus gdip_format_string(GpGraphics *graphics,
nwidth
=
roundr
(
rect
->
Width
);
nwidth
=
roundr
(
rect
->
Width
);
nheight
=
roundr
(
rect
->
Height
);
nheight
=
roundr
(
rect
->
Height
);
if
(
nwidth
==
0
)
nwidth
=
INT_MAX
;
if
(
nwidth
==
0
||
rect
->
Width
>=
INT_MAX
)
nwidth
=
INT_MAX
;
if
(
nheight
==
0
)
nheight
=
INT_MAX
;
if
(
nheight
==
0
||
rect
->
Height
>=
INT_MAX
)
nheight
=
INT_MAX
;
for
(
i
=
0
,
j
=
0
;
i
<
length
;
i
++
){
for
(
i
=
0
,
j
=
0
;
i
<
length
;
i
++
){
/* FIXME: This makes the indexes passed to callback inaccurate. */
/* FIXME: This makes the indexes passed to callback inaccurate. */
...
...
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