Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc
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
Commits
837ce238
Commit
837ce238
authored
Apr 14, 2010
by
Jean-Paul Saman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
freetype: various fixes
- zero terminate strings - fix potential memleak
parent
4a33ee31
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
7 deletions
+11
-7
modules/misc/freetype.c
modules/misc/freetype.c
+11
-7
No files found.
modules/misc/freetype.c
View file @
837ce238
...
...
@@ -300,9 +300,8 @@ static int Create( vlc_object_t *p_this )
FcResult
fontresult
=
FcResultMatch
;
#endif
/* Allocate structure */
p_filter
->
p_sys
=
p_sys
=
malloc
(
sizeof
(
filter_sys_t
)
);
p_filter
->
p_sys
=
p_sys
=
calloc
(
1
,
sizeof
(
filter_sys_t
)
);
if
(
!
p_sys
)
return
VLC_ENOMEM
;
#ifdef HAVE_FONTCONFIG
...
...
@@ -339,15 +338,16 @@ static int Create( vlc_object_t *p_this )
GetWindowsDirectory
(
psz_fontfamily
,
PATH_MAX
+
1
);
strcat
(
psz_fontfamily
,
"
\\
fonts
\\
arial.ttf"
);
# else
str
cpy
(
psz_fontfamily
,
DEFAULT_FONT
);
str
ncpy
(
psz_fontfamily
,
DEFAULT_FONT
,
PATH_MAX
);
# endif
msg_Err
(
p_filter
,
"User didn't specify fontfile, using %s"
,
psz_fontfamily
);
#endif
psz_fontfamily
[
PATH_MAX
-
1
]
=
'\0'
;
}
#ifdef HAVE_FONTCONFIG
/* Lets find some fontfile from freetype-font variable family */
char
*
psz_fontsize
;
char
*
psz_fontsize
=
NULL
;
if
(
asprintf
(
&
psz_fontsize
,
"%d"
,
p_sys
->
i_default_font_size
)
==
-
1
)
goto
error
;
...
...
@@ -370,11 +370,10 @@ static int Create( vlc_object_t *p_this )
strcat
(
path
,
"
\\
fonts"
);
if
(
p_dialog
)
dialog_ProgressSet
(
p_dialog
,
NULL
,
0
.
4
);
path
[
PATH_MAX
-
1
]
=
'\0'
;
FcConfigAppFontAddDir
(
NULL
,
path
);
free
(
path
);
if
(
p_dialog
)
dialog_ProgressSet
(
p_dialog
,
NULL
,
0
.
5
);
#endif
...
...
@@ -389,7 +388,6 @@ static int Create( vlc_object_t *p_this )
msg_Dbg
(
p_filter
,
"Took %ld microseconds"
,
(
long
)((
t2
-
t1
))
);
fontpattern
=
FcPatternCreate
();
if
(
!
fontpattern
)
{
msg_Err
(
p_filter
,
"Creating fontpattern failed"
);
...
...
@@ -651,6 +649,12 @@ static int Render( filter_t *p_filter, subpicture_region_t *p_region,
if
(
!
p_region
->
p_picture
)
return
VLC_EGENERIC
;
fmt
.
p_palette
=
p_region
->
fmt
.
p_palette
?
p_region
->
fmt
.
p_palette
:
malloc
(
sizeof
(
*
fmt
.
p_palette
));
if
(
!
fmt
.
p_palette
)
{
picture_Delete
(
p_region
->
p_picture
);
p_region
->
p_picture
=
NULL
;
return
VLC_ENOMEM
;
}
p_region
->
fmt
=
fmt
;
/* Calculate text color components */
...
...
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