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
056bc939
Commit
056bc939
authored
Sep 30, 2019
by
Paul B Mahol
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avfilter/vf_photosensitivity: fix memleak
parent
c888adf5
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
1 deletion
+6
-1
vf_photosensitivity.c
libavfilter/vf_photosensitivity.c
+6
-1
No files found.
libavfilter/vf_photosensitivity.c
View file @
056bc939
...
@@ -220,6 +220,7 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in)
...
@@ -220,6 +220,7 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in)
int
this_badness
,
current_badness
,
fixed_badness
,
new_badness
,
i
,
res
;
int
this_badness
,
current_badness
,
fixed_badness
,
new_badness
,
i
,
res
;
PhotosensitivityFrame
ef
;
PhotosensitivityFrame
ef
;
AVFrame
*
src
,
*
out
;
AVFrame
*
src
,
*
out
;
int
free_in
=
0
;
float
factor
;
float
factor
;
AVDictionary
**
metadata
;
AVDictionary
**
metadata
;
...
@@ -270,12 +271,14 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in)
...
@@ -270,12 +271,14 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in)
s
->
history
[
s
->
history_pos
]
=
this_badness
;
s
->
history
[
s
->
history_pos
]
=
this_badness
;
}
}
src
=
s
->
last_frame_av
;
src
=
s
->
last_frame_av
;
free_in
=
1
;
}
}
s
->
history_pos
=
(
s
->
history_pos
+
1
)
%
s
->
nb_frames
;
s
->
history_pos
=
(
s
->
history_pos
+
1
)
%
s
->
nb_frames
;
out
=
ff_get_video_buffer
(
outlink
,
in
->
width
,
in
->
height
);
out
=
ff_get_video_buffer
(
outlink
,
in
->
width
,
in
->
height
);
if
(
!
out
)
{
if
(
!
out
)
{
av_frame_free
(
&
in
);
if
(
free_in
==
1
)
av_frame_free
(
&
in
);
return
AVERROR
(
ENOMEM
);
return
AVERROR
(
ENOMEM
);
}
}
av_frame_copy_props
(
out
,
in
);
av_frame_copy_props
(
out
,
in
);
...
@@ -296,6 +299,8 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in)
...
@@ -296,6 +299,8 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in)
av_dict_set
(
metadata
,
"lavfi.photosensitivity.factor"
,
value
,
0
);
av_dict_set
(
metadata
,
"lavfi.photosensitivity.factor"
,
value
,
0
);
}
}
av_frame_copy
(
out
,
src
);
av_frame_copy
(
out
,
src
);
if
(
free_in
==
1
)
av_frame_free
(
&
in
);
return
ff_filter_frame
(
outlink
,
out
);
return
ff_filter_frame
(
outlink
,
out
);
}
}
...
...
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