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
58bb9d3a
Commit
58bb9d3a
authored
Oct 19, 2019
by
Paul B Mahol
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avfilter/af_tremolo: fix heap-buffer overflow
Fixes #8317
parent
26876fdb
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
3 deletions
+5
-3
af_tremolo.c
libavfilter/af_tremolo.c
+5
-3
No files found.
libavfilter/af_tremolo.c
View file @
58bb9d3a
...
@@ -28,6 +28,7 @@ typedef struct TremoloContext {
...
@@ -28,6 +28,7 @@ typedef struct TremoloContext {
double
freq
;
double
freq
;
double
depth
;
double
depth
;
double
*
table
;
double
*
table
;
int
table_size
;
int
index
;
int
index
;
}
TremoloContext
;
}
TremoloContext
;
...
@@ -72,7 +73,7 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in)
...
@@ -72,7 +73,7 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in)
dst
+=
channels
;
dst
+=
channels
;
src
+=
channels
;
src
+=
channels
;
s
->
index
++
;
s
->
index
++
;
if
(
s
->
index
>=
inlink
->
sample_rate
/
s
->
freq
)
if
(
s
->
index
>=
s
->
table_size
)
s
->
index
=
0
;
s
->
index
=
0
;
}
}
...
@@ -125,11 +126,12 @@ static int config_input(AVFilterLink *inlink)
...
@@ -125,11 +126,12 @@ static int config_input(AVFilterLink *inlink)
const
double
offset
=
1
.
-
s
->
depth
/
2
.;
const
double
offset
=
1
.
-
s
->
depth
/
2
.;
int
i
;
int
i
;
s
->
table
=
av_malloc_array
(
inlink
->
sample_rate
/
s
->
freq
,
sizeof
(
*
s
->
table
));
s
->
table_size
=
inlink
->
sample_rate
/
s
->
freq
;
s
->
table
=
av_malloc_array
(
s
->
table_size
,
sizeof
(
*
s
->
table
));
if
(
!
s
->
table
)
if
(
!
s
->
table
)
return
AVERROR
(
ENOMEM
);
return
AVERROR
(
ENOMEM
);
for
(
i
=
0
;
i
<
inlink
->
sample_rate
/
s
->
freq
;
i
++
)
{
for
(
i
=
0
;
i
<
s
->
table_size
;
i
++
)
{
double
env
=
s
->
freq
*
i
/
inlink
->
sample_rate
;
double
env
=
s
->
freq
*
i
/
inlink
->
sample_rate
;
env
=
sin
(
2
*
M_PI
*
fmod
(
env
+
0
.
25
,
1
.
0
));
env
=
sin
(
2
*
M_PI
*
fmod
(
env
+
0
.
25
,
1
.
0
));
s
->
table
[
i
]
=
env
*
(
1
-
fabs
(
offset
))
+
offset
;
s
->
table
[
i
]
=
env
*
(
1
-
fabs
(
offset
))
+
offset
;
...
...
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