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
88d1fb4e
Commit
88d1fb4e
authored
Apr 03, 2015
by
Himangi Saraogi
Committed by
Vittorio Giovara
Apr 19, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
filtfmts: Avoid null pointer dereference
parent
a1d58e3b
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
2 deletions
+13
-2
filtfmts.c
libavfilter/filtfmts.c
+13
-2
No files found.
libavfilter/filtfmts.c
View file @
88d1fb4e
...
...
@@ -33,7 +33,7 @@ int main(int argc, char **argv)
AVFilterGraph
*
graph_ctx
;
const
char
*
filter_name
;
const
char
*
filter_args
=
NULL
;
int
i
,
j
;
int
i
,
j
,
ret
=
0
;
av_log_set_level
(
AV_LOG_DEBUG
);
...
...
@@ -74,11 +74,21 @@ int main(int argc, char **argv)
/* create a link for each of the input pads */
for
(
i
=
0
;
i
<
filter_ctx
->
nb_inputs
;
i
++
)
{
AVFilterLink
*
link
=
av_mallocz
(
sizeof
(
AVFilterLink
));
if
(
!
link
)
{
fprintf
(
stderr
,
"Unable to allocate memory for filter input link
\n
"
);
ret
=
1
;
goto
fail
;
}
link
->
type
=
avfilter_pad_get_type
(
filter_ctx
->
filter
->
inputs
,
i
);
filter_ctx
->
inputs
[
i
]
=
link
;
}
for
(
i
=
0
;
i
<
filter_ctx
->
nb_outputs
;
i
++
)
{
AVFilterLink
*
link
=
av_mallocz
(
sizeof
(
AVFilterLink
));
if
(
!
link
)
{
fprintf
(
stderr
,
"Unable to allocate memory for filter output link
\n
"
);
ret
=
1
;
goto
fail
;
}
link
->
type
=
avfilter_pad_get_type
(
filter_ctx
->
filter
->
outputs
,
i
);
filter_ctx
->
outputs
[
i
]
=
link
;
}
...
...
@@ -106,8 +116,9 @@ int main(int argc, char **argv)
av_get_pix_fmt_name
(
fmts
->
formats
[
j
]));
}
fail:
avfilter_free
(
filter_ctx
);
avfilter_graph_free
(
&
graph_ctx
);
fflush
(
stdout
);
return
0
;
return
ret
;
}
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