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
a3655a5c
Commit
a3655a5c
authored
Oct 10, 2019
by
Steven Liu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avformat/smacker: fix memleak when avformat_new_stream failed
Signed-off-by:
Steven Liu
<
lq@chinaffmpeg.org
>
parent
991cf95f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
2 deletions
+8
-2
smacker.c
libavformat/smacker.c
+8
-2
No files found.
libavformat/smacker.c
View file @
a3655a5c
...
...
@@ -172,8 +172,11 @@ static int smacker_read_header(AVFormatContext *s)
/* init video codec */
st
=
avformat_new_stream
(
s
,
NULL
);
if
(
!
st
)
if
(
!
st
)
{
av_freep
(
&
smk
->
frm_size
);
av_freep
(
&
smk
->
frm_flags
);
return
AVERROR
(
ENOMEM
);
}
smk
->
videoindex
=
st
->
index
;
st
->
codecpar
->
width
=
smk
->
width
;
st
->
codecpar
->
height
=
smk
->
height
;
...
...
@@ -195,8 +198,11 @@ static int smacker_read_header(AVFormatContext *s)
smk
->
indexes
[
i
]
=
-
1
;
if
(
smk
->
rates
[
i
])
{
ast
[
i
]
=
avformat_new_stream
(
s
,
NULL
);
if
(
!
ast
[
i
])
if
(
!
ast
[
i
])
{
av_freep
(
&
smk
->
frm_size
);
av_freep
(
&
smk
->
frm_flags
);
return
AVERROR
(
ENOMEM
);
}
smk
->
indexes
[
i
]
=
ast
[
i
]
->
index
;
ast
[
i
]
->
codecpar
->
codec_type
=
AVMEDIA_TYPE_AUDIO
;
if
(
smk
->
aflags
[
i
]
&
SMK_AUD_BINKAUD
)
{
...
...
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