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
f3d57dc6
Commit
f3d57dc6
authored
Sep 11, 2013
by
Martin Storsjö
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
smacker: Free memory properly if the init function fails
Signed-off-by:
Martin Storsjö
<
martin@martin.st
>
parent
0679cec6
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
21 deletions
+23
-21
smacker.c
libavcodec/smacker.c
+23
-21
No files found.
libavcodec/smacker.c
View file @
f3d57dc6
...
...
@@ -532,6 +532,26 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame,
/*
*
* Uninit smacker decoder
*
*/
static
av_cold
int
decode_end
(
AVCodecContext
*
avctx
)
{
SmackVContext
*
const
smk
=
avctx
->
priv_data
;
av_freep
(
&
smk
->
mmap_tbl
);
av_freep
(
&
smk
->
mclr_tbl
);
av_freep
(
&
smk
->
full_tbl
);
av_freep
(
&
smk
->
type_tbl
);
av_frame_unref
(
&
smk
->
pic
);
return
0
;
}
/*
*
* Init smacker decoder
...
...
@@ -552,34 +572,16 @@ static av_cold int decode_init(AVCodecContext *avctx)
return
-
1
;
}
if
(
decode_header_trees
(
c
))
if
(
decode_header_trees
(
c
))
{
decode_end
(
avctx
);
return
-
1
;
}
return
0
;
}
/*
*
* Uninit smacker decoder
*
*/
static
av_cold
int
decode_end
(
AVCodecContext
*
avctx
)
{
SmackVContext
*
const
smk
=
avctx
->
priv_data
;
av_freep
(
&
smk
->
mmap_tbl
);
av_freep
(
&
smk
->
mclr_tbl
);
av_freep
(
&
smk
->
full_tbl
);
av_freep
(
&
smk
->
type_tbl
);
av_frame_unref
(
&
smk
->
pic
);
return
0
;
}
static
av_cold
int
smka_decode_init
(
AVCodecContext
*
avctx
)
{
if
(
avctx
->
channels
<
1
||
avctx
->
channels
>
2
)
{
...
...
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