Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
4def66c1
Commit
4def66c1
authored
Apr 14, 2014
by
Vincent Povirk
Committed by
Alexandre Julliard
Apr 14, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gdiplus: Prevent NULL StringFormat in gdip_format_string.
parent
8df04798
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
8 deletions
+16
-8
graphics.c
dlls/gdiplus/graphics.c
+16
-8
No files found.
dlls/gdiplus/graphics.c
View file @
4def66c1
...
...
@@ -4392,12 +4392,24 @@ GpStatus gdip_format_string(HDC hdc,
INT
hotkeyprefix_count
=
0
;
INT
hotkeyprefix_pos
=
0
,
hotkeyprefix_end_pos
=
0
;
BOOL
seen_prefix
=
FALSE
;
GpStringFormat
*
dyn_format
=
NULL
;
if
(
length
==
-
1
)
length
=
lstrlenW
(
string
);
stringdup
=
GdipAlloc
((
length
+
1
)
*
sizeof
(
WCHAR
));
if
(
!
stringdup
)
return
OutOfMemory
;
if
(
!
format
)
{
stat
=
GdipStringFormatGetGenericDefault
(
&
dyn_format
);
if
(
stat
!=
Ok
)
{
GdipFree
(
stringdup
);
return
stat
;
}
format
=
dyn_format
;
}
nwidth
=
rect
->
Width
;
nheight
=
rect
->
Height
;
if
(
ignore_empty_clip
)
...
...
@@ -4406,10 +4418,7 @@ GpStatus gdip_format_string(HDC hdc,
if
(
!
nheight
)
nheight
=
INT_MAX
;
}
if
(
format
)
hkprefix
=
format
->
hkprefix
;
else
hkprefix
=
HotkeyPrefixNone
;
hkprefix
=
format
->
hkprefix
;
if
(
hkprefix
==
HotkeyPrefixShow
)
{
...
...
@@ -4450,8 +4459,7 @@ GpStatus gdip_format_string(HDC hdc,
length
=
j
;
if
(
format
)
halign
=
format
->
align
;
else
halign
=
StringAlignmentNear
;
halign
=
format
->
align
;
while
(
sum
<
length
){
GetTextExtentExPointW
(
hdc
,
stringdup
+
sum
,
length
-
sum
,
...
...
@@ -4544,13 +4552,13 @@ GpStatus gdip_format_string(HDC hdc,
break
;
/* Stop if this was a linewrap (but not if it was a linebreak). */
if
((
lret
==
fitcpy
)
&&
format
&&
(
format
->
attr
&
StringFormatFlagsNoWrap
))
if
((
lret
==
fitcpy
)
&&
(
format
->
attr
&
StringFormatFlagsNoWrap
))
break
;
}
GdipFree
(
stringdup
);
GdipFree
(
hotkeyprefix_offsets
);
GdipDeleteStringFormat
(
dyn_format
);
return
stat
;
}
...
...
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