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
62d92a87
Commit
62d92a87
authored
Jan 29, 2020
by
Marton Balint
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avfilter/vf_drawtext: do not overread text if the last UTF8 sequence is invalid
Signed-off-by:
Marton Balint
<
cus@passwd.hu
>
parent
5ac8389c
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
3 deletions
+3
-3
vf_drawtext.c
libavfilter/vf_drawtext.c
+3
-3
No files found.
libavfilter/vf_drawtext.c
View file @
62d92a87
...
@@ -1225,7 +1225,7 @@ static int draw_glyphs(DrawTextContext *s, AVFrame *frame,
...
@@ -1225,7 +1225,7 @@ static int draw_glyphs(DrawTextContext *s, AVFrame *frame,
for
(
i
=
0
,
p
=
text
;
*
p
;
i
++
)
{
for
(
i
=
0
,
p
=
text
;
*
p
;
i
++
)
{
FT_Bitmap
bitmap
;
FT_Bitmap
bitmap
;
Glyph
dummy
=
{
0
};
Glyph
dummy
=
{
0
};
GET_UTF8
(
code
,
*
p
++
,
code
=
0xfffd
;
goto
continue_on_invalid
;);
GET_UTF8
(
code
,
*
p
?
*
p
++
:
0
,
code
=
0xfffd
;
goto
continue_on_invalid
;);
continue_on_invalid:
continue_on_invalid:
/* skip new line chars, just go to new line */
/* skip new line chars, just go to new line */
...
@@ -1364,7 +1364,7 @@ static int draw_text(AVFilterContext *ctx, AVFrame *frame,
...
@@ -1364,7 +1364,7 @@ static int draw_text(AVFilterContext *ctx, AVFrame *frame,
/* load and cache glyphs */
/* load and cache glyphs */
for
(
i
=
0
,
p
=
text
;
*
p
;
i
++
)
{
for
(
i
=
0
,
p
=
text
;
*
p
;
i
++
)
{
GET_UTF8
(
code
,
*
p
++
,
code
=
0xfffd
;
goto
continue_on_invalid
;);
GET_UTF8
(
code
,
*
p
?
*
p
++
:
0
,
code
=
0xfffd
;
goto
continue_on_invalid
;);
continue_on_invalid:
continue_on_invalid:
/* get glyph */
/* get glyph */
...
@@ -1388,7 +1388,7 @@ continue_on_invalid:
...
@@ -1388,7 +1388,7 @@ continue_on_invalid:
/* compute and save position for each glyph */
/* compute and save position for each glyph */
glyph
=
NULL
;
glyph
=
NULL
;
for
(
i
=
0
,
p
=
text
;
*
p
;
i
++
)
{
for
(
i
=
0
,
p
=
text
;
*
p
;
i
++
)
{
GET_UTF8
(
code
,
*
p
++
,
code
=
0xfffd
;
goto
continue_on_invalid2
;);
GET_UTF8
(
code
,
*
p
?
*
p
++
:
0
,
code
=
0xfffd
;
goto
continue_on_invalid2
;);
continue_on_invalid2:
continue_on_invalid2:
/* skip the \n in the sequence \r\n */
/* skip the \n in the sequence \r\n */
...
...
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