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
237ed217
Commit
237ed217
authored
Feb 08, 2013
by
Aric Stewart
Committed by
Alexandre Julliard
Feb 08, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
usp10: Fix memory leak when a font has 0 languages, scripts or features.
Based on original fix proposded by Wojciech Pyczak.
parent
c8b5a16f
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
4 deletions
+21
-4
opentype.c
dlls/usp10/opentype.c
+18
-4
usp10_internal.h
dlls/usp10/usp10_internal.h
+3
-0
No files found.
dlls/usp10/opentype.c
View file @
237ed217
...
...
@@ -1898,6 +1898,9 @@ static void GPOS_expand_script_cache(ScriptCache *psc)
script
=
(
const
OT_ScriptList
*
)((
const
BYTE
*
)
header
+
GET_BE_WORD
(
header
->
ScriptList
));
count
=
GET_BE_WORD
(
script
->
ScriptCount
);
if
(
!
count
)
return
;
if
(
!
psc
->
script_count
)
{
psc
->
script_count
=
count
;
...
...
@@ -1941,10 +1944,11 @@ static void GPOS_expand_script_cache(ScriptCache *psc)
static
void
_initialize_script_cache
(
ScriptCache
*
psc
)
{
if
(
!
psc
->
script
_count
)
if
(
!
psc
->
script
s_initialized
)
{
GSUB_initialize_script_cache
(
psc
);
GPOS_expand_script_cache
(
psc
);
psc
->
scripts_initialized
=
TRUE
;
}
}
...
...
@@ -2029,6 +2033,10 @@ static void GPOS_expand_language_cache(LoadedScript *script)
count
=
GET_BE_WORD
(
table
->
LangSysCount
);
TRACE
(
"Deflang %p, LangCount %i
\n
"
,
script
->
default_language
.
gpos_table
,
count
);
if
(
!
count
)
return
;
if
(
!
script
->
language_count
)
{
int
i
;
...
...
@@ -2072,10 +2080,11 @@ static void GPOS_expand_language_cache(LoadedScript *script)
static
void
_initialize_language_cache
(
LoadedScript
*
script
)
{
if
(
!
script
->
language
_count
)
if
(
!
script
->
language
s_initialized
)
{
GSUB_initialize_language_cache
(
script
);
GPOS_expand_language_cache
(
script
);
script
->
languages_initialized
=
TRUE
;
}
}
...
...
@@ -2194,6 +2203,10 @@ static void GPOS_expand_feature_cache(LPCVOID table, LoadedLanguage *language)
feature_list
=
(
const
OT_FeatureList
*
)((
const
BYTE
*
)
header
+
GET_BE_WORD
(
header
->
FeatureList
));
TRACE
(
"%i features
\n
"
,
count
);
if
(
!
count
)
return
;
if
(
!
language
->
feature_count
)
{
language
->
feature_count
=
count
;
...
...
@@ -2219,7 +2232,7 @@ static void GPOS_expand_feature_cache(LPCVOID table, LoadedLanguage *language)
}
}
}
else
if
(
count
)
else
{
language
->
features
=
HeapReAlloc
(
GetProcessHeap
(),
0
,
language
->
features
,
sizeof
(
LoadedFeature
)
*
(
language
->
feature_count
+
count
));
...
...
@@ -2245,10 +2258,11 @@ static void GPOS_expand_feature_cache(LPCVOID table, LoadedLanguage *language)
static
void
_initialize_feature_cache
(
ScriptCache
*
psc
,
LoadedLanguage
*
language
)
{
if
(
!
language
->
feature
_count
)
if
(
!
language
->
feature
s_initialized
)
{
GSUB_initialize_feature_cache
(
psc
->
GSUB_Table
,
language
);
GPOS_expand_feature_cache
(
psc
->
GPOS_Table
,
language
);
language
->
features_initialized
=
TRUE
;
}
}
...
...
dlls/usp10/usp10_internal.h
View file @
237ed217
...
...
@@ -144,6 +144,7 @@ typedef struct {
OPENTYPE_TAG
tag
;
LPCVOID
gsub_table
;
LPCVOID
gpos_table
;
BOOL
features_initialized
;
INT
feature_count
;
LoadedFeature
*
features
;
}
LoadedLanguage
;
...
...
@@ -153,6 +154,7 @@ typedef struct {
LPCVOID
gsub_table
;
LPCVOID
gpos_table
;
LoadedLanguage
default_language
;
BOOL
languages_initialized
;
INT
language_count
;
LoadedLanguage
*
languages
;
}
LoadedScript
;
...
...
@@ -174,6 +176,7 @@ typedef struct {
LPVOID
CMAP_Table
;
LPVOID
CMAP_format12_Table
;
LPVOID
GPOS_Table
;
BOOL
scripts_initialized
;
INT
script_count
;
LoadedScript
*
scripts
;
...
...
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