Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
F
ffmpeg.wasm-core
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
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Linshizhi
ffmpeg.wasm-core
Commits
4582e116
Commit
4582e116
authored
Jul 02, 2014
by
Leandro Santiago
Committed by
Michael Niedermayer
Jul 03, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avfilter/vf_drawtext: fix resource leak
Signed-off-by:
Michael Niedermayer
<
michaelni@gmx.at
>
parent
a3c479fc
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
4 deletions
+7
-4
vf_drawtext.c
libavfilter/vf_drawtext.c
+7
-4
No files found.
libavfilter/vf_drawtext.c
View file @
4582e116
...
...
@@ -262,6 +262,7 @@ struct ft_error
typedef
struct
Glyph
{
FT_Glyph
*
glyph
;
FT_Glyph
border_glyph
;
uint32_t
code
;
FT_Bitmap
bitmap
;
///< array holding bitmaps of font
FT_Bitmap
border_bitmap
;
///< array holding bitmaps of font border
...
...
@@ -306,13 +307,13 @@ static int load_glyph(AVFilterContext *ctx, Glyph **glyph_ptr, uint32_t code)
goto
error
;
}
if
(
s
->
borderw
)
{
FT_Glyph
border_glyph
=
*
glyph
->
glyph
;
if
(
FT_Glyph_StrokeBorder
(
&
border_glyph
,
s
->
stroker
,
0
,
0
)
||
FT_Glyph_To_Bitmap
(
&
border_glyph
,
FT_RENDER_MODE_NORMAL
,
0
,
1
))
{
glyph
->
border_glyph
=
*
glyph
->
glyph
;
if
(
FT_Glyph_StrokeBorder
(
&
glyph
->
border_glyph
,
s
->
stroker
,
0
,
0
)
||
FT_Glyph_To_Bitmap
(
&
glyph
->
border_glyph
,
FT_RENDER_MODE_NORMAL
,
0
,
1
))
{
ret
=
AVERROR_EXTERNAL
;
goto
error
;
}
bitmapglyph
=
(
FT_BitmapGlyph
)
border_glyph
;
bitmapglyph
=
(
FT_BitmapGlyph
)
glyph
->
border_glyph
;
glyph
->
border_bitmap
=
bitmapglyph
->
bitmap
;
}
if
(
FT_Glyph_To_Bitmap
(
glyph
->
glyph
,
FT_RENDER_MODE_NORMAL
,
0
,
1
))
{
...
...
@@ -343,6 +344,7 @@ static int load_glyph(AVFilterContext *ctx, Glyph **glyph_ptr, uint32_t code)
error:
if
(
glyph
)
av_freep
(
&
glyph
->
glyph
);
av_freep
(
&
glyph
);
av_freep
(
&
node
);
return
ret
;
...
...
@@ -584,6 +586,7 @@ static int glyph_enu_free(void *opaque, void *elem)
Glyph
*
glyph
=
elem
;
FT_Done_Glyph
(
*
glyph
->
glyph
);
FT_Done_Glyph
(
glyph
->
border_glyph
);
av_freep
(
&
glyph
->
glyph
);
av_free
(
elem
);
return
0
;
...
...
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