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
b367e902
Commit
b367e902
authored
Apr 27, 2010
by
Jeff Latimer
Committed by
Alexandre Julliard
Apr 27, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
usp10: Check that there are sufficient script_items before setting the last pointer.
parent
6c0e61cd
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
5 deletions
+16
-5
usp10.c
dlls/usp10/tests/usp10.c
+10
-0
usp10.c
dlls/usp10/usp10.c
+6
-5
No files found.
dlls/usp10/tests/usp10.c
View file @
b367e902
...
...
@@ -673,6 +673,7 @@ static void test_ScriptItemIzeShapePlace(HDC hdc, unsigned short pwOutGlyphs[256
WCHAR
TestItem3
[]
=
{
'T'
,
'e'
,
's'
,
't'
,
'c'
,
' '
,
'1'
,
'2'
,
'3'
,
' '
,
' '
,
'e'
,
'n'
,
'd'
,
0
};
WCHAR
TestItem4
[]
=
{
'T'
,
'e'
,
's'
,
't'
,
'd'
,
' '
,
0x0684
,
0x0694
,
0x06a4
,
' '
,
' '
,
'\r'
,
'\n'
,
'e'
,
'n'
,
'd'
,
0
};
WCHAR
TestItem5
[]
=
{
0x0684
,
'T'
,
'e'
,
's'
,
't'
,
'e'
,
' '
,
0x0684
,
0x0694
,
0x06a4
,
' '
,
' '
,
'e'
,
'n'
,
'd'
,
0
};
WCHAR
TestItem6
[]
=
{
'T'
,
'e'
,
's'
,
't'
,
'f'
,
' '
,
' '
,
' '
,
'\r'
,
'\n'
,
'e'
,
'n'
,
'd'
,
0
};
SCRIPT_CACHE
psc
;
int
cChars
;
...
...
@@ -848,6 +849,15 @@ static void test_ScriptItemIzeShapePlace(HDC hdc, unsigned short pwOutGlyphs[256
ok
(
pcItems
==
4
,
"There should have been 4 items, found %d
\n
"
,
pcItems
);
ok
(
pItem
[
0
].
a
.
s
.
uBidiLevel
==
1
,
"The first character should have been bidi=1 not %d
\n
"
,
pItem
[
0
].
a
.
s
.
uBidiLevel
);
/* This test checks to make sure that the test to see if there are sufficient buffers to store *
* the pointer to the last char works. Note that windows often needs a greater number of *
* SCRIPT_ITEMS to process a string than is returned in pcItems. */
cInChars
=
(
sizeof
(
TestItem6
)
/
2
)
-
1
;
cMaxItems
=
4
;
hr
=
ScriptItemize
(
TestItem6
,
cInChars
,
cMaxItems
,
NULL
,
NULL
,
pItem
,
&
pcItems
);
ok
(
hr
==
E_OUTOFMEMORY
,
"ScriptItemize should return E_OUTOFMEMORY, returned %08x
\n
"
,
hr
);
}
static
void
test_ScriptGetCMap
(
HDC
hdc
,
unsigned
short
pwOutGlyphs
[
256
])
...
...
dlls/usp10/usp10.c
View file @
b367e902
...
...
@@ -669,16 +669,17 @@ HRESULT WINAPI ScriptItemize(const WCHAR *pwcInChars, int cInChars, int cMaxItem
/* While not strictly necessary according to the spec, make sure the n+1
* item is set up to prevent random behaviour if the caller erroneously
* checks the n+1 structure */
memset
(
&
pItems
[
index
+
1
].
a
,
0
,
sizeof
(
SCRIPT_ANALYSIS
));
index
++
;
memset
(
&
pItems
[
index
].
a
,
0
,
sizeof
(
SCRIPT_ANALYSIS
));
TRACE
(
"index=%d cnt=%d iCharPos=%d
\n
"
,
index
+
1
,
cnt
,
pItems
[
index
+
1
].
iCharPos
);
TRACE
(
"index=%d cnt=%d iCharPos=%d
\n
"
,
index
,
cnt
,
pItems
[
index
].
iCharPos
);
/* Set one SCRIPT_STATE item being returned */
if
(
pcItems
)
*
pcItems
=
index
+
1
;
if
(
index
+
1
>
cMaxItems
)
return
E_OUTOFMEMORY
;
if
(
pcItems
)
*
pcItems
=
index
;
/* Set SCRIPT_ITEM */
pItems
[
index
+
1
].
iCharPos
=
cnt
;
/* the last + 1 item
contains the ptr to the lastchar */
pItems
[
index
].
iCharPos
=
cnt
;
/* the last item contains the ptr to the lastchar */
heap_free
(
levels
);
return
S_OK
;
}
...
...
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