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
40730460
Commit
40730460
authored
Nov 20, 2017
by
Paul B Mahol
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avfilter/af_headphone: add missing error check
Signed-off-by:
Paul B Mahol
<
onemda@gmail.com
>
parent
d1b28411
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
7 deletions
+14
-7
af_headphone.c
libavfilter/af_headphone.c
+14
-7
No files found.
libavfilter/af_headphone.c
View file @
40730460
...
@@ -324,16 +324,19 @@ static int read_ir(AVFilterLink *inlink, AVFrame *frame)
...
@@ -324,16 +324,19 @@ static int read_ir(AVFilterLink *inlink, AVFrame *frame)
{
{
AVFilterContext
*
ctx
=
inlink
->
dst
;
AVFilterContext
*
ctx
=
inlink
->
dst
;
HeadphoneContext
*
s
=
ctx
->
priv
;
HeadphoneContext
*
s
=
ctx
->
priv
;
int
ir_len
,
max_ir_len
,
input_number
;
int
ir_len
,
max_ir_len
,
input_number
,
ret
;
for
(
input_number
=
0
;
input_number
<
s
->
nb_inputs
;
input_number
++
)
for
(
input_number
=
0
;
input_number
<
s
->
nb_inputs
;
input_number
++
)
if
(
inlink
==
ctx
->
inputs
[
input_number
])
if
(
inlink
==
ctx
->
inputs
[
input_number
])
break
;
break
;
av_audio_fifo_write
(
s
->
in
[
input_number
].
fifo
,
(
void
**
)
frame
->
extended_data
,
ret
=
av_audio_fifo_write
(
s
->
in
[
input_number
].
fifo
,
(
void
**
)
frame
->
extended_data
,
frame
->
nb_samples
);
frame
->
nb_samples
);
av_frame_free
(
&
frame
);
av_frame_free
(
&
frame
);
if
(
ret
<
0
)
return
ret
;
ir_len
=
av_audio_fifo_size
(
s
->
in
[
input_number
].
fifo
);
ir_len
=
av_audio_fifo_size
(
s
->
in
[
input_number
].
fifo
);
max_ir_len
=
65536
;
max_ir_len
=
65536
;
if
(
ir_len
>
max_ir_len
)
{
if
(
ir_len
>
max_ir_len
)
{
...
@@ -572,13 +575,16 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in)
...
@@ -572,13 +575,16 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in)
AVFilterLink
*
outlink
=
ctx
->
outputs
[
0
];
AVFilterLink
*
outlink
=
ctx
->
outputs
[
0
];
int
ret
=
0
;
int
ret
=
0
;
av_audio_fifo_write
(
s
->
in
[
0
].
fifo
,
(
void
**
)
in
->
extended_data
,
ret
=
av_audio_fifo_write
(
s
->
in
[
0
].
fifo
,
(
void
**
)
in
->
extended_data
,
in
->
nb_samples
);
in
->
nb_samples
);
if
(
s
->
pts
==
AV_NOPTS_VALUE
)
if
(
s
->
pts
==
AV_NOPTS_VALUE
)
s
->
pts
=
in
->
pts
;
s
->
pts
=
in
->
pts
;
av_frame_free
(
&
in
);
av_frame_free
(
&
in
);
if
(
ret
<
0
)
return
ret
;
if
(
!
s
->
have_hrirs
&&
s
->
eof_hrirs
)
{
if
(
!
s
->
have_hrirs
&&
s
->
eof_hrirs
)
{
ret
=
convert_coeffs
(
ctx
,
inlink
);
ret
=
convert_coeffs
(
ctx
,
inlink
);
if
(
ret
<
0
)
if
(
ret
<
0
)
...
@@ -589,10 +595,11 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in)
...
@@ -589,10 +595,11 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in)
while
(
av_audio_fifo_size
(
s
->
in
[
0
].
fifo
)
>=
s
->
size
)
{
while
(
av_audio_fifo_size
(
s
->
in
[
0
].
fifo
)
>=
s
->
size
)
{
ret
=
headphone_frame
(
s
,
outlink
);
ret
=
headphone_frame
(
s
,
outlink
);
if
(
ret
<
0
)
if
(
ret
<
0
)
break
;
return
ret
;
}
}
}
}
return
ret
;
return
0
;
}
}
static
int
query_formats
(
AVFilterContext
*
ctx
)
static
int
query_formats
(
AVFilterContext
*
ctx
)
...
...
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