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
abb5e37f
Commit
abb5e37f
authored
Dec 18, 2013
by
Vittorio Giovara
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avfilter: fix leaks on error in ff_filter_frame
parent
5655732c
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
6 deletions
+19
-6
avfilter.c
libavfilter/avfilter.c
+19
-6
No files found.
libavfilter/avfilter.c
View file @
abb5e37f
...
...
@@ -729,7 +729,8 @@ int ff_filter_frame(AVFilterLink *link, AVFrame *frame)
{
int
(
*
filter_frame
)(
AVFilterLink
*
,
AVFrame
*
);
AVFilterPad
*
dst
=
link
->
dstpad
;
AVFrame
*
out
;
AVFrame
*
out
=
NULL
;
int
ret
;
FF_DPRINTF_START
(
NULL
,
filter_frame
);
ff_dlog_link
(
NULL
,
link
,
1
);
...
...
@@ -748,13 +749,18 @@ int ff_filter_frame(AVFilterLink *link, AVFrame *frame)
case
AVMEDIA_TYPE_AUDIO
:
out
=
ff_get_audio_buffer
(
link
,
frame
->
nb_samples
);
break
;
default:
return
AVERROR
(
EINVAL
);
default:
ret
=
AVERROR
(
EINVAL
);
goto
fail
;
}
if
(
!
out
)
{
av_frame_free
(
&
frame
);
return
AVERROR
(
ENOMEM
)
;
ret
=
AVERROR
(
ENOMEM
);
goto
fail
;
}
av_frame_copy_props
(
out
,
frame
);
ret
=
av_frame_copy_props
(
out
,
frame
);
if
(
ret
<
0
)
goto
fail
;
switch
(
link
->
type
)
{
case
AVMEDIA_TYPE_VIDEO
:
...
...
@@ -767,7 +773,9 @@ int ff_filter_frame(AVFilterLink *link, AVFrame *frame)
av_get_channel_layout_nb_channels
(
frame
->
channel_layout
),
frame
->
format
);
break
;
default:
return
AVERROR
(
EINVAL
);
default:
ret
=
AVERROR
(
EINVAL
);
goto
fail
;
}
av_frame_free
(
&
frame
);
...
...
@@ -775,6 +783,11 @@ int ff_filter_frame(AVFilterLink *link, AVFrame *frame)
out
=
frame
;
return
filter_frame
(
link
,
out
);
fail:
av_frame_free
(
&
out
);
av_frame_free
(
&
frame
);
return
ret
;
}
const
AVClass
*
avfilter_get_class
(
void
)
...
...
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