Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-gpu
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
videolan
vlc-gpu
Commits
6f2d1380
Commit
6f2d1380
authored
Jul 30, 2009
by
Rémi Duraffort
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fontconfig: factorize and fix memleaks.
parent
754491fc
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
13 deletions
+7
-13
modules/misc/freetype.c
modules/misc/freetype.c
+7
-13
No files found.
modules/misc/freetype.c
View file @
6f2d1380
...
@@ -297,7 +297,7 @@ static int Create( vlc_object_t *p_this )
...
@@ -297,7 +297,7 @@ static int Create( vlc_object_t *p_this )
int
i_error
,
fontindex
;
int
i_error
,
fontindex
;
#ifdef HAVE_FONTCONFIG
#ifdef HAVE_FONTCONFIG
FcPattern
*
fontpattern
,
*
fontmatch
;
FcPattern
*
fontpattern
=
NULL
,
*
fontmatch
=
NULL
;
FcResult
fontresult
=
FcResultNoMatch
;
FcResult
fontresult
=
FcResultNoMatch
;
#endif
#endif
...
@@ -359,28 +359,18 @@ static int Create( vlc_object_t *p_this )
...
@@ -359,28 +359,18 @@ static int Create( vlc_object_t *p_this )
free
(
psz_fontsize
);
free
(
psz_fontsize
);
if
(
FcConfigSubstitute
(
NULL
,
fontpattern
,
FcMatchPattern
)
==
FcFalse
)
if
(
FcConfigSubstitute
(
NULL
,
fontpattern
,
FcMatchPattern
)
==
FcFalse
)
{
FcPatternDestroy
(
fontpattern
);
goto
error
;
goto
error
;
}
FcDefaultSubstitute
(
fontpattern
);
FcDefaultSubstitute
(
fontpattern
);
fontmatch
=
FcFontMatch
(
NULL
,
fontpattern
,
&
fontresult
);
fontmatch
=
FcFontMatch
(
NULL
,
fontpattern
,
&
fontresult
);
if
(
!
fontmatch
||
fontresult
==
FcResultNoMatch
)
if
(
!
fontmatch
||
fontresult
==
FcResultNoMatch
)
{
FcPatternDestroy
(
fontpattern
);
goto
error
;
goto
error
;
}
FcPatternGetString
(
fontmatch
,
FC_FILE
,
0
,
(
FcChar8
**
)
&
psz_fontfile
);
FcPatternGetString
(
fontmatch
,
FC_FILE
,
0
,
(
FcChar8
**
)
&
psz_fontfile
);
FcPatternGetInteger
(
fontmatch
,
FC_INDEX
,
0
,
&
fontindex
);
FcPatternGetInteger
(
fontmatch
,
FC_INDEX
,
0
,
&
fontindex
);
if
(
!
psz_fontfile
)
if
(
!
psz_fontfile
)
{
FcPatternDestroy
(
fontpattern
);
FcPatternDestroy
(
fontmatch
);
goto
error
;
goto
error
;
}
msg_Dbg
(
p_filter
,
"Using %s as font from file %s"
,
psz_fontfamily
,
psz_fontfile
);
msg_Dbg
(
p_filter
,
"Using %s as font from file %s"
,
psz_fontfamily
,
psz_fontfile
);
#else
#else
psz_fontfile
=
psz_fontfamily
;
psz_fontfile
=
psz_fontfamily
;
#endif
#endif
...
@@ -441,7 +431,11 @@ static int Create( vlc_object_t *p_this )
...
@@ -441,7 +431,11 @@ static int Create( vlc_object_t *p_this )
return
VLC_SUCCESS
;
return
VLC_SUCCESS
;
error:
error:
#ifdef HAVE_FONTCONFIG
if
(
fontmatch
)
FcPatternDestroy
(
fontmatch
);
if
(
fontpattern
)
FcPatternDestroy
(
fontpattern
);
#endif
if
(
p_sys
->
p_face
)
FT_Done_Face
(
p_sys
->
p_face
);
if
(
p_sys
->
p_face
)
FT_Done_Face
(
p_sys
->
p_face
);
if
(
p_sys
->
p_library
)
FT_Done_FreeType
(
p_sys
->
p_library
);
if
(
p_sys
->
p_library
)
FT_Done_FreeType
(
p_sys
->
p_library
);
free
(
psz_fontfile
);
free
(
psz_fontfile
);
...
...
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