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
119d06b0
Commit
119d06b0
authored
Aug 18, 2015
by
Jean-Baptiste Kempf
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Freetype: code cosmetics
parent
a1a02efe
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
4 deletions
+7
-4
modules/text_renderer/freetype.c
modules/text_renderer/freetype.c
+7
-4
No files found.
modules/text_renderer/freetype.c
View file @
119d06b0
...
@@ -902,20 +902,20 @@ static uni_char_t* SegmentsToTextAndStyles( filter_t *p_filter, const text_segme
...
@@ -902,20 +902,20 @@ static uni_char_t* SegmentsToTextAndStyles( filter_t *p_filter, const text_segme
uni_char_t
*
psz_uni
=
NULL
;
uni_char_t
*
psz_uni
=
NULL
;
size_t
i_size
=
0
;
size_t
i_size
=
0
;
size_t
i_nb_char
=
0
;
size_t
i_nb_char
=
0
;
for
(
const
text_segment_t
*
s
=
p_segment
;
s
!=
NULL
;
s
=
s
->
p_next
)
for
(
const
text_segment_t
*
s
=
p_segment
;
s
!=
NULL
;
s
=
s
->
p_next
)
{
{
if
(
!
s
->
psz_text
)
if
(
!
s
->
psz_text
)
continue
;
continue
;
size_t
i_string_bytes
=
0
;
size_t
i_string_bytes
=
0
;
uni_char_t
*
psz_tmp
=
ToCharset
(
FREETYPE_TO_UCS
,
s
->
psz_text
,
&
i_string_bytes
);
uni_char_t
*
psz_tmp
=
ToCharset
(
FREETYPE_TO_UCS
,
s
->
psz_text
,
&
i_string_bytes
);
if
(
!
psz_tmp
)
if
(
!
psz_tmp
)
{
{
free
(
psz_uni
);
free
(
psz_uni
);
free
(
pp_styles
);
free
(
pp_styles
);
return
NULL
;
return
NULL
;
}
}
uni_char_t
*
psz_realloc
=
realloc
(
psz_uni
,
i_size
+
i_string_bytes
);
uni_char_t
*
psz_realloc
=
realloc
(
psz_uni
,
i_size
+
i_string_bytes
);
if
(
unlikely
(
!
psz_realloc
)
)
if
(
unlikely
(
!
psz_realloc
)
)
{
{
free
(
pp_styles
);
free
(
pp_styles
);
free
(
psz_uni
);
free
(
psz_uni
);
...
@@ -925,6 +925,7 @@ static uni_char_t* SegmentsToTextAndStyles( filter_t *p_filter, const text_segme
...
@@ -925,6 +925,7 @@ static uni_char_t* SegmentsToTextAndStyles( filter_t *p_filter, const text_segme
psz_uni
=
psz_realloc
;
psz_uni
=
psz_realloc
;
memcpy
(
psz_uni
+
i_nb_char
,
psz_tmp
,
i_string_bytes
);
memcpy
(
psz_uni
+
i_nb_char
,
psz_tmp
,
i_string_bytes
);
free
(
psz_tmp
);
free
(
psz_tmp
);
// We want one text_style_t* per character. The amount of characters is the number of bytes divided by
// We want one text_style_t* per character. The amount of characters is the number of bytes divided by
// the size of one glyph, in byte
// the size of one glyph, in byte
const
text_style_t
**
pp_styles_realloc
=
realloc
(
pp_styles
,
(
(
i_size
+
i_string_bytes
)
/
sizeof
(
*
psz_uni
)
*
sizeof
(
*
pp_styles
)
)
);
const
text_style_t
**
pp_styles_realloc
=
realloc
(
pp_styles
,
(
(
i_size
+
i_string_bytes
)
/
sizeof
(
*
psz_uni
)
*
sizeof
(
*
pp_styles
)
)
);
...
@@ -935,6 +936,7 @@ static uni_char_t* SegmentsToTextAndStyles( filter_t *p_filter, const text_segme
...
@@ -935,6 +936,7 @@ static uni_char_t* SegmentsToTextAndStyles( filter_t *p_filter, const text_segme
return
NULL
;
return
NULL
;
}
}
pp_styles
=
pp_styles_realloc
;
pp_styles
=
pp_styles_realloc
;
// We're actually writing to a read only object, something's wrong with the conception.
// We're actually writing to a read only object, something's wrong with the conception.
text_style_t
*
p_style
=
text_style_Duplicate
(
p_filter
->
p_sys
->
p_style
);
text_style_t
*
p_style
=
text_style_Duplicate
(
p_filter
->
p_sys
->
p_style
);
if
(
p_style
==
NULL
)
if
(
p_style
==
NULL
)
...
@@ -1319,6 +1321,7 @@ static void Destroy( vlc_object_t *p_this )
...
@@ -1319,6 +1321,7 @@ static void Destroy( vlc_object_t *p_this )
free
(
p_sys
);
free
(
p_sys
);
}
}
/* Face loading */
bool
FaceStyleEquals
(
const
text_style_t
*
p_style1
,
bool
FaceStyleEquals
(
const
text_style_t
*
p_style1
,
const
text_style_t
*
p_style2
)
const
text_style_t
*
p_style2
)
{
{
...
...
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