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
63e1b3f5
Commit
63e1b3f5
authored
Feb 08, 2016
by
Nikolay Sivov
Committed by
Alexandre Julliard
Feb 08, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dwrite: Don't create enumerator with invalid palette.
Signed-off-by:
Nikolay Sivov
<
nsivov@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
ec3c7d9d
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
30 additions
and
3 deletions
+30
-3
font.c
dlls/dwrite/font.c
+1
-1
font.c
dlls/dwrite/tests/font.c
+29
-2
No files found.
dlls/dwrite/font.c
View file @
63e1b3f5
...
...
@@ -4643,7 +4643,7 @@ HRESULT create_colorglyphenum(FLOAT originX, FLOAT originY, const DWRITE_GLYPH_R
return
hr
;
}
colorfont
=
IDWriteFontFace2_IsColorFont
(
fontface2
);
colorfont
=
IDWriteFontFace2_IsColorFont
(
fontface2
)
&&
IDWriteFontFace2_GetColorPaletteCount
(
fontface2
)
>
palette
;
IDWriteFontFace2_Release
(
fontface2
);
if
(
!
colorfont
)
return
DWRITE_E_NOCOLOR
;
...
...
dlls/dwrite/tests/font.c
View file @
63e1b3f5
...
...
@@ -5137,6 +5137,7 @@ static void test_TranslateColorGlyphRun(void)
{
IDWriteColorGlyphRunEnumerator
*
layers
;
const
DWRITE_COLOR_GLYPH_RUN
*
colorrun
;
IDWriteFontFace2
*
fontface2
;
IDWriteFontFace
*
fontface
;
IDWriteFactory2
*
factory2
;
IDWriteFactory
*
factory
;
...
...
@@ -5200,9 +5201,12 @@ static void test_TranslateColorGlyphRun(void)
layers
=
NULL
;
hr
=
IDWriteFactory2_TranslateColorGlyphRun
(
factory2
,
0
.
0
,
0
.
0
,
&
run
,
NULL
,
DWRITE_MEASURING_MODE_NATURAL
,
NULL
,
0
,
&
layers
);
todo_wine
{
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
ok
(
layers
!=
NULL
,
"got %p
\n
"
,
layers
);
}
if
(
layers
)
{
while
(
1
)
{
hasrun
=
FALSE
;
hr
=
IDWriteColorGlyphRunEnumerator_MoveNext
(
layers
,
&
hasrun
);
...
...
@@ -5219,6 +5223,26 @@ todo_wine
ok
(
hr
==
E_NOT_VALID_STATE
,
"got 0x%08x
\n
"
,
hr
);
IDWriteColorGlyphRunEnumerator_Release
(
layers
);
}
hr
=
IDWriteFontFace_QueryInterface
(
fontface
,
&
IID_IDWriteFontFace2
,
(
void
**
)
&
fontface2
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
/* invalid palette index */
layers
=
(
void
*
)
0xdeadbeef
;
hr
=
IDWriteFactory2_TranslateColorGlyphRun
(
factory2
,
0
.
0
f
,
0
.
0
f
,
&
run
,
NULL
,
DWRITE_MEASURING_MODE_NATURAL
,
NULL
,
IDWriteFontFace2_GetColorPaletteCount
(
fontface2
),
&
layers
);
ok
(
hr
==
DWRITE_E_NOCOLOR
,
"got 0x%08x
\n
"
,
hr
);
ok
(
layers
==
NULL
,
"got %p
\n
"
,
layers
);
layers
=
NULL
;
hr
=
IDWriteFactory2_TranslateColorGlyphRun
(
factory2
,
0
.
0
f
,
0
.
0
f
,
&
run
,
NULL
,
DWRITE_MEASURING_MODE_NATURAL
,
NULL
,
IDWriteFontFace2_GetColorPaletteCount
(
fontface2
)
-
1
,
&
layers
);
todo_wine
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
if
(
layers
)
IDWriteColorGlyphRunEnumerator_Release
(
layers
);
/* color font, glyph without color info */
codepoints
[
0
]
=
'A'
;
...
...
@@ -5228,10 +5252,9 @@ todo_wine
layers
=
(
void
*
)
0xdeadbeef
;
hr
=
IDWriteFactory2_TranslateColorGlyphRun
(
factory2
,
0
.
0
,
0
.
0
,
&
run
,
NULL
,
DWRITE_MEASURING_MODE_NATURAL
,
NULL
,
0
,
&
layers
);
todo_wine
{
ok
(
hr
==
DWRITE_E_NOCOLOR
,
"got 0x%08x
\n
"
,
hr
);
ok
(
layers
==
NULL
,
"got %p
\n
"
,
layers
);
}
/* one glyph with, one without */
codepoints
[
0
]
=
'A'
;
codepoints
[
1
]
=
0x26c4
;
...
...
@@ -5244,10 +5267,14 @@ todo_wine {
layers
=
NULL
;
hr
=
IDWriteFactory2_TranslateColorGlyphRun
(
factory2
,
0
.
0
,
0
.
0
,
&
run
,
NULL
,
DWRITE_MEASURING_MODE_NATURAL
,
NULL
,
0
,
&
layers
);
todo_wine
{
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
ok
(
layers
!=
NULL
,
"got %p
\n
"
,
layers
);
}
if
(
layers
)
IDWriteColorGlyphRunEnumerator_Release
(
layers
);
IDWriteFontFace2_Release
(
fontface2
);
IDWriteFontFace_Release
(
fontface
);
IDWriteFactory2_Release
(
factory2
);
}
...
...
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