Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-1.1
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-1.1
Commits
d275c501
Commit
d275c501
authored
Sep 20, 2004
by
Gildas Bazin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
* modules/misc/freetype.c: fixed memory leak.
parent
b4e29cc5
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
9 deletions
+12
-9
modules/misc/freetype.c
modules/misc/freetype.c
+12
-9
No files found.
modules/misc/freetype.c
View file @
d275c501
...
@@ -396,7 +396,7 @@ static subpicture_t *RenderText( filter_t *p_filter, block_t *p_block )
...
@@ -396,7 +396,7 @@ static subpicture_t *RenderText( filter_t *p_filter, block_t *p_block )
subpicture_data_t
*
p_string
=
0
;
subpicture_data_t
*
p_string
=
0
;
line_desc_t
*
p_line
=
0
,
*
p_next
=
0
;
line_desc_t
*
p_line
=
0
,
*
p_next
=
0
;
int
i
,
i_pen_y
,
i_pen_x
,
i_error
,
i_glyph_index
,
i_previous
;
int
i
,
i_pen_y
,
i_pen_x
,
i_error
,
i_glyph_index
,
i_previous
;
uint32_t
*
p
_unicode_string
,
i_char
;
uint32_t
*
p
sz_unicode
,
*
psz_unicode_orig
=
0
,
i_char
;
int
i_string_length
;
int
i_string_length
;
char
*
psz_string
;
char
*
psz_string
;
vlc_iconv_t
iconv_handle
=
(
vlc_iconv_t
)(
-
1
);
vlc_iconv_t
iconv_handle
=
(
vlc_iconv_t
)(
-
1
);
...
@@ -437,8 +437,9 @@ static subpicture_t *RenderText( filter_t *p_filter, block_t *p_block )
...
@@ -437,8 +437,9 @@ static subpicture_t *RenderText( filter_t *p_filter, block_t *p_block )
p_string
->
p_lines
=
0
;
p_string
->
p_lines
=
0
;
p_string
->
psz_text
=
strdup
(
psz_string
);
p_string
->
psz_text
=
strdup
(
psz_string
);
p_unicode_string
=
malloc
(
(
strlen
(
psz_string
)
+
1
)
*
sizeof
(
uint32_t
)
);
psz_unicode
=
psz_unicode_orig
=
if
(
p_unicode_string
==
NULL
)
malloc
(
(
strlen
(
psz_string
)
+
1
)
*
sizeof
(
uint32_t
)
);
if
(
psz_unicode
==
NULL
)
{
{
msg_Err
(
p_filter
,
"Out of memory"
);
msg_Err
(
p_filter
,
"Out of memory"
);
goto
error
;
goto
error
;
...
@@ -461,7 +462,7 @@ static subpicture_t *RenderText( filter_t *p_filter, block_t *p_block )
...
@@ -461,7 +462,7 @@ static subpicture_t *RenderText( filter_t *p_filter, block_t *p_block )
i_out_bytes
=
i_in_bytes
*
sizeof
(
uint32_t
);
i_out_bytes
=
i_in_bytes
*
sizeof
(
uint32_t
);
i_out_bytes_left
=
i_out_bytes
;
i_out_bytes_left
=
i_out_bytes
;
p_in_buffer
=
psz_string
;
p_in_buffer
=
psz_string
;
p_out_buffer
=
(
char
*
)
p
_unicode_string
;
p_out_buffer
=
(
char
*
)
p
sz_unicode
;
i_ret
=
vlc_iconv
(
iconv_handle
,
&
p_in_buffer
,
&
i_in_bytes
,
i_ret
=
vlc_iconv
(
iconv_handle
,
&
p_in_buffer
,
&
i_in_bytes
,
&
p_out_buffer
,
&
i_out_bytes_left
);
&
p_out_buffer
,
&
i_out_bytes_left
);
...
@@ -482,10 +483,10 @@ static subpicture_t *RenderText( filter_t *p_filter, block_t *p_block )
...
@@ -482,10 +483,10 @@ static subpicture_t *RenderText( filter_t *p_filter, block_t *p_block )
uint32_t
*
p_fribidi_string
;
uint32_t
*
p_fribidi_string
;
FriBidiCharType
base_dir
=
FRIBIDI_TYPE_ON
;
FriBidiCharType
base_dir
=
FRIBIDI_TYPE_ON
;
p_fribidi_string
=
malloc
(
(
i_string_length
+
1
)
*
sizeof
(
uint32_t
)
);
p_fribidi_string
=
malloc
(
(
i_string_length
+
1
)
*
sizeof
(
uint32_t
)
);
fribidi_log2vis
(
(
FriBidiChar
*
)
p
_unicode_string
,
i_string_length
,
fribidi_log2vis
(
(
FriBidiChar
*
)
p
sz_unicode
,
i_string_length
,
&
base_dir
,
(
FriBidiChar
*
)
p_fribidi_string
,
0
,
0
,
0
);
&
base_dir
,
(
FriBidiChar
*
)
p_fribidi_string
,
0
,
0
,
0
);
free
(
p
_unicode_strin
g
);
free
(
p
sz_unicode_ori
g
);
p
_unicode_strin
g
=
p_fribidi_string
;
p
sz_unicode
=
psz_unicode_ori
g
=
p_fribidi_string
;
p_fribidi_string
[
i_string_length
]
=
0
;
p_fribidi_string
[
i_string_length
]
=
0
;
}
}
#endif
#endif
...
@@ -507,9 +508,9 @@ static subpicture_t *RenderText( filter_t *p_filter, block_t *p_block )
...
@@ -507,9 +508,9 @@ static subpicture_t *RenderText( filter_t *p_filter, block_t *p_block )
#define face p_sys->p_face
#define face p_sys->p_face
#define glyph face->glyph
#define glyph face->glyph
while
(
*
p
_unicode_string
)
while
(
*
p
sz_unicode
)
{
{
i_char
=
*
p
_unicode_string
++
;
i_char
=
*
p
sz_unicode
++
;
if
(
i_char
==
'\r'
)
/* ignore CR chars wherever they may be */
if
(
i_char
==
'\r'
)
/* ignore CR chars wherever they may be */
{
{
continue
;
continue
;
...
@@ -597,12 +598,14 @@ static subpicture_t *RenderText( filter_t *p_filter, block_t *p_block )
...
@@ -597,12 +598,14 @@ static subpicture_t *RenderText( filter_t *p_filter, block_t *p_block )
Render
(
p_filter
,
p_subpic
,
p_string
);
Render
(
p_filter
,
p_subpic
,
p_string
);
FreeString
(
p_string
);
FreeString
(
p_string
);
block_Release
(
p_block
);
block_Release
(
p_block
);
if
(
psz_unicode_orig
)
free
(
psz_unicode_orig
);
return
p_subpic
;
return
p_subpic
;
error:
error:
FreeString
(
p_string
);
FreeString
(
p_string
);
if
(
p_subpic
)
p_filter
->
pf_sub_buffer_del
(
p_filter
,
p_subpic
);
if
(
p_subpic
)
p_filter
->
pf_sub_buffer_del
(
p_filter
,
p_subpic
);
block_Release
(
p_block
);
block_Release
(
p_block
);
if
(
psz_unicode_orig
)
free
(
psz_unicode_orig
);
return
NULL
;
return
NULL
;
}
}
...
...
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