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
2962101e
Commit
2962101e
authored
Sep 25, 2019
by
Paul B Mahol
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avfilter/vf_fieldmatch: fix more leaks
parent
0d05aa05
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
10 deletions
+20
-10
vf_fieldmatch.c
libavfilter/vf_fieldmatch.c
+20
-10
No files found.
libavfilter/vf_fieldmatch.c
View file @
2962101e
...
...
@@ -679,7 +679,7 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in)
AVFilterLink
*
outlink
=
ctx
->
outputs
[
0
];
FieldMatchContext
*
fm
=
ctx
->
priv
;
int
combs
[]
=
{
-
1
,
-
1
,
-
1
,
-
1
,
-
1
};
int
order
,
field
,
i
,
match
,
sc
=
0
;
int
order
,
field
,
i
,
match
,
sc
=
0
,
ret
=
0
;
const
int
*
fxo
;
AVFrame
*
gen_frames
[]
=
{
NULL
,
NULL
,
NULL
,
NULL
,
NULL
};
AVFrame
*
dst
;
...
...
@@ -725,16 +725,20 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in)
if
(
i
>
mN
&&
fm
->
combdbg
==
COMBDBG_PCN
)
break
;
gen_frames
[
i
]
=
create_weave_frame
(
ctx
,
i
,
field
,
fm
->
prv
,
fm
->
src
,
fm
->
nxt
);
if
(
!
gen_frames
[
i
])
return
AVERROR
(
ENOMEM
);
if
(
!
gen_frames
[
i
])
{
ret
=
AVERROR
(
ENOMEM
);
goto
fail
;
}
combs
[
i
]
=
calc_combed_score
(
fm
,
gen_frames
[
i
]);
}
av_log
(
ctx
,
AV_LOG_INFO
,
"COMBS: %3d %3d %3d %3d %3d
\n
"
,
combs
[
0
],
combs
[
1
],
combs
[
2
],
combs
[
3
],
combs
[
4
]);
}
else
{
gen_frames
[
mC
]
=
av_frame_clone
(
fm
->
src
);
if
(
!
gen_frames
[
mC
])
return
AVERROR
(
ENOMEM
);
if
(
!
gen_frames
[
mC
])
{
ret
=
AVERROR
(
ENOMEM
);
goto
fail
;
}
}
/* p/c selection and optional 3-way p/c/n matches */
...
...
@@ -801,10 +805,10 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in)
gen_frames
[
match
]
=
NULL
;
}
}
if
(
!
dst
)
ret
urn
AVERROR
(
ENOMEM
);
for
(
i
=
0
;
i
<
FF_ARRAY_ELEMS
(
gen_frames
);
i
++
)
av_frame_free
(
&
gen_frames
[
i
]);
if
(
!
dst
)
{
ret
=
AVERROR
(
ENOMEM
);
goto
fail
;
}
/* mark the frame we are unable to match properly as interlaced so a proper
* de-interlacer can take the relay */
...
...
@@ -819,7 +823,13 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in)
" match=%d combed=%s
\n
"
,
sc
,
combs
[
0
],
combs
[
1
],
combs
[
2
],
combs
[
3
],
combs
[
4
],
fm
->
combpel
,
match
,
dst
->
interlaced_frame
?
"YES"
:
"NO"
);
return
ff_filter_frame
(
outlink
,
dst
);
fail:
for
(
i
=
0
;
i
<
FF_ARRAY_ELEMS
(
gen_frames
);
i
++
)
av_frame_free
(
&
gen_frames
[
i
]);
if
(
ret
>=
0
)
return
ff_filter_frame
(
outlink
,
dst
);
return
ret
;
}
static
int
activate
(
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