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
e2bce62a
Commit
e2bce62a
authored
Sep 26, 2013
by
Akihiro Sagawa
Committed by
Alexandre Julliard
Sep 26, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gdi32: Return GDI_ERROR when requested empty glyph bitmaps.
parent
2693d5af
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
10 deletions
+15
-10
freetype.c
dlls/gdi32/freetype.c
+14
-9
font.c
dlls/gdi32/tests/font.c
+1
-1
No files found.
dlls/gdi32/freetype.c
View file @
e2bce62a
...
...
@@ -6518,12 +6518,14 @@ static DWORD get_glyph_outline(GdiFont *incoming_font, UINT glyph, UINT format,
}
}
lpgm
->
gmBlackBoxX
=
(
right
-
left
)
>>
6
;
lpgm
->
gmBlackBoxY
=
(
top
-
bottom
)
>>
6
;
width
=
(
right
-
left
)
>>
6
;
height
=
(
top
-
bottom
)
>>
6
;
lpgm
->
gmBlackBoxX
=
width
;
lpgm
->
gmBlackBoxY
=
height
;
lpgm
->
gmptGlyphOrigin
.
x
=
origin_x
>>
6
;
lpgm
->
gmptGlyphOrigin
.
y
=
origin_y
>>
6
;
abc
->
abcA
=
left
>>
6
;
abc
->
abcB
=
(
right
-
left
)
>>
6
;
abc
->
abcB
=
width
;
abc
->
abcC
=
adv
-
abc
->
abcA
-
abc
->
abcB
;
TRACE
(
"%u,%u,%s,%d,%d
\n
"
,
lpgm
->
gmBlackBoxX
,
lpgm
->
gmBlackBoxY
,
...
...
@@ -6552,12 +6554,11 @@ static DWORD get_glyph_outline(GdiFont *incoming_font, UINT glyph, UINT format,
switch
(
format
)
{
case
GGO_BITMAP
:
width
=
lpgm
->
gmBlackBoxX
;
height
=
lpgm
->
gmBlackBoxY
;
pitch
=
((
width
+
31
)
>>
5
)
<<
2
;
needed
=
pitch
*
height
;
if
(
!
buf
||
!
buflen
)
break
;
if
(
!
needed
)
return
GDI_ERROR
;
/* empty glyph */
switch
(
ft_face
->
glyph
->
format
)
{
case
ft_glyph_format_bitmap
:
...
...
@@ -6604,12 +6605,11 @@ static DWORD get_glyph_outline(GdiFont *incoming_font, UINT glyph, UINT format,
unsigned
int
max_level
,
row
,
col
;
BYTE
*
start
,
*
ptr
;
width
=
lpgm
->
gmBlackBoxX
;
height
=
lpgm
->
gmBlackBoxY
;
pitch
=
(
width
+
3
)
/
4
*
4
;
needed
=
pitch
*
height
;
if
(
!
buf
||
!
buflen
)
break
;
if
(
!
needed
)
return
GDI_ERROR
;
/* empty glyph */
max_level
=
get_max_level
(
format
);
...
...
@@ -6677,12 +6677,11 @@ static DWORD get_glyph_outline(GdiFont *incoming_font, UINT glyph, UINT format,
BYTE
*
src
,
*
dst
;
INT
src_pitch
,
x
;
width
=
lpgm
->
gmBlackBoxX
;
height
=
lpgm
->
gmBlackBoxY
;
pitch
=
width
*
4
;
needed
=
pitch
*
height
;
if
(
!
buf
||
!
buflen
)
break
;
if
(
!
needed
)
return
GDI_ERROR
;
/* empty glyph */
memset
(
buf
,
0
,
buflen
);
dst
=
buf
;
...
...
@@ -6716,6 +6715,12 @@ static DWORD get_glyph_outline(GdiFont *incoming_font, UINT glyph, UINT format,
(
format
==
WINE_GGO_HRGB_BITMAP
||
format
==
WINE_GGO_HBGR_BITMAP
)
?
FT_RENDER_MODE_LCD:
FT_RENDER_MODE_LCD_V
;
if
(
!
width
||
!
height
)
{
if
(
!
buf
||
!
buflen
)
return
0
;
return
GDI_ERROR
;
}
if
(
lcdfilter
==
FT_LCD_FILTER_DEFAULT
||
lcdfilter
==
FT_LCD_FILTER_LIGHT
)
{
if
(
render_mode
==
FT_RENDER_MODE_LCD
)
...
...
dlls/gdi32/tests/font.c
View file @
e2bce62a
...
...
@@ -4169,7 +4169,7 @@ static void test_GetGlyphOutline(void)
}
}
else
todo_wine
ok
(
ret
==
GDI_ERROR
,
"%2d:GetGlyphOutlineW should return GDI_ERROR, got %d
\n
"
,
fmt
[
i
],
ret
);
ok
(
ret
==
GDI_ERROR
,
"%2d:GetGlyphOutlineW should return GDI_ERROR, got %d
\n
"
,
fmt
[
i
],
ret
);
}
}
...
...
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