Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
F
ffmpeg
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
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
ffmpeg
Commits
ed8373e7
Commit
ed8373e7
authored
Apr 08, 2013
by
Paul B Mahol
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
lavfi: always check return value of ff_get_{audio,video}_buffer()
Signed-off-by:
Paul B Mahol
<
onemda@gmail.com
>
parent
e82f562f
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
25 additions
and
1 deletion
+25
-1
af_aconvert.c
libavfilter/af_aconvert.c
+2
-0
af_amerge.c
libavfilter/af_amerge.c
+2
-0
af_asetnsamples.c
libavfilter/af_asetnsamples.c
+2
-1
af_atempo.c
libavfilter/af_atempo.c
+4
-0
af_pan.c
libavfilter/af_pan.c
+2
-0
asrc_aevalsrc.c
libavfilter/asrc_aevalsrc.c
+2
-0
vf_tinterlace.c
libavfilter/vf_tinterlace.c
+2
-0
vsrc_cellauto.c
libavfilter/vsrc_cellauto.c
+2
-0
vsrc_life.c
libavfilter/vsrc_life.c
+2
-0
vsrc_mandelbrot.c
libavfilter/vsrc_mandelbrot.c
+3
-0
vsrc_mptestsrc.c
libavfilter/vsrc_mptestsrc.c
+2
-0
No files found.
libavfilter/af_aconvert.c
View file @
ed8373e7
...
...
@@ -143,6 +143,8 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *insamplesref)
AVFrame
*
outsamplesref
=
ff_get_audio_buffer
(
outlink
,
n
);
int
ret
;
if
(
!
outsamplesref
)
return
AVERROR
(
ENOMEM
);
swr_convert
(
aconvert
->
swr
,
outsamplesref
->
extended_data
,
n
,
(
void
*
)
insamplesref
->
extended_data
,
n
);
...
...
libavfilter/af_amerge.c
View file @
ed8373e7
...
...
@@ -248,6 +248,8 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *insamples)
return
0
;
outbuf
=
ff_get_audio_buffer
(
ctx
->
outputs
[
0
],
nb_samples
);
if
(
!
outbuf
)
return
AVERROR
(
ENOMEM
);
outs
=
outbuf
->
data
[
0
];
for
(
i
=
0
;
i
<
am
->
nb_inputs
;
i
++
)
{
inbuf
[
i
]
=
ff_bufqueue_peek
(
&
am
->
in
[
i
].
queue
,
0
);
...
...
libavfilter/af_asetnsamples.c
View file @
ed8373e7
...
...
@@ -108,7 +108,8 @@ static int push_samples(AVFilterLink *outlink)
return
0
;
outsamples
=
ff_get_audio_buffer
(
outlink
,
nb_out_samples
);
av_assert0
(
outsamples
);
if
(
!
outsamples
)
return
AVERROR
(
ENOMEM
);
av_audio_fifo_read
(
asns
->
fifo
,
(
void
**
)
outsamples
->
extended_data
,
nb_out_samples
);
...
...
libavfilter/af_atempo.c
View file @
ed8373e7
...
...
@@ -1062,6 +1062,8 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *src_buffer)
while
(
src
<
src_end
)
{
if
(
!
atempo
->
dst_buffer
)
{
atempo
->
dst_buffer
=
ff_get_audio_buffer
(
outlink
,
n_out
);
if
(
!
atempo
->
dst_buffer
)
return
AVERROR
(
ENOMEM
);
av_frame_copy_props
(
atempo
->
dst_buffer
,
src_buffer
);
atempo
->
dst
=
atempo
->
dst_buffer
->
data
[
0
];
...
...
@@ -1100,6 +1102,8 @@ static int request_frame(AVFilterLink *outlink)
while
(
err
==
AVERROR
(
EAGAIN
))
{
if
(
!
atempo
->
dst_buffer
)
{
atempo
->
dst_buffer
=
ff_get_audio_buffer
(
outlink
,
n_max
);
if
(
!
atempo
->
dst_buffer
)
return
AVERROR
(
ENOMEM
);
atempo
->
dst
=
atempo
->
dst_buffer
->
data
[
0
];
atempo
->
dst_end
=
atempo
->
dst
+
n_max
*
atempo
->
stride
;
...
...
libavfilter/af_pan.c
View file @
ed8373e7
...
...
@@ -361,6 +361,8 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *insamples)
AVFrame
*
outsamples
=
ff_get_audio_buffer
(
outlink
,
n
);
PanContext
*
pan
=
inlink
->
dst
->
priv
;
if
(
!
outsamples
)
return
AVERROR
(
ENOMEM
);
swr_convert
(
pan
->
swr
,
outsamples
->
data
,
n
,
(
void
*
)
insamples
->
data
,
n
);
av_frame_copy_props
(
outsamples
,
insamples
);
outsamples
->
channel_layout
=
outlink
->
channel_layout
;
...
...
libavfilter/asrc_aevalsrc.c
View file @
ed8373e7
...
...
@@ -220,6 +220,8 @@ static int request_frame(AVFilterLink *outlink)
return
AVERROR_EOF
;
samplesref
=
ff_get_audio_buffer
(
outlink
,
eval
->
nb_samples
);
if
(
!
samplesref
)
return
AVERROR
(
ENOMEM
);
/* evaluate expression for each single sample and for each channel */
for
(
i
=
0
;
i
<
eval
->
nb_samples
;
i
++
,
eval
->
n
++
)
{
...
...
libavfilter/vf_tinterlace.c
View file @
ed8373e7
...
...
@@ -266,6 +266,8 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *picref)
case
MODE_PAD
:
/* expand each frame to double height, but pad alternate
* lines with black; framerate unchanged */
out
=
ff_get_video_buffer
(
outlink
,
outlink
->
w
,
outlink
->
h
);
if
(
!
out
)
return
AVERROR
(
ENOMEM
);
av_frame_copy_props
(
out
,
cur
);
out
->
height
=
outlink
->
h
;
...
...
libavfilter/vsrc_cellauto.c
View file @
ed8373e7
...
...
@@ -294,6 +294,8 @@ static int request_frame(AVFilterLink *outlink)
{
CellAutoContext
*
cellauto
=
outlink
->
src
->
priv
;
AVFrame
*
picref
=
ff_get_video_buffer
(
outlink
,
cellauto
->
w
,
cellauto
->
h
);
if
(
!
picref
)
return
AVERROR
(
ENOMEM
);
picref
->
sample_aspect_ratio
=
(
AVRational
)
{
1
,
1
};
if
(
cellauto
->
generation
==
0
&&
cellauto
->
start_full
)
{
int
i
;
...
...
libavfilter/vsrc_life.c
View file @
ed8373e7
...
...
@@ -420,6 +420,8 @@ static int request_frame(AVFilterLink *outlink)
{
LifeContext
*
life
=
outlink
->
src
->
priv
;
AVFrame
*
picref
=
ff_get_video_buffer
(
outlink
,
life
->
w
,
life
->
h
);
if
(
!
picref
)
return
AVERROR
(
ENOMEM
);
picref
->
sample_aspect_ratio
=
(
AVRational
)
{
1
,
1
};
picref
->
pts
=
life
->
pts
++
;
...
...
libavfilter/vsrc_mandelbrot.c
View file @
ed8373e7
...
...
@@ -403,6 +403,9 @@ static int request_frame(AVFilterLink *link)
{
MBContext
*
mb
=
link
->
src
->
priv
;
AVFrame
*
picref
=
ff_get_video_buffer
(
link
,
mb
->
w
,
mb
->
h
);
if
(
!
picref
)
return
AVERROR
(
ENOMEM
);
picref
->
sample_aspect_ratio
=
(
AVRational
)
{
1
,
1
};
picref
->
pts
=
mb
->
pts
++
;
...
...
libavfilter/vsrc_mptestsrc.c
View file @
ed8373e7
...
...
@@ -323,6 +323,8 @@ static int request_frame(AVFilterLink *outlink)
if
(
test
->
max_pts
>=
0
&&
test
->
pts
>
test
->
max_pts
)
return
AVERROR_EOF
;
picref
=
ff_get_video_buffer
(
outlink
,
w
,
h
);
if
(
!
picref
)
return
AVERROR
(
ENOMEM
);
picref
->
pts
=
test
->
pts
++
;
// clean image
...
...
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