Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
FFmpeg
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
libremedia
Tethys
FFmpeg
Commits
f3d57dc6
Commit
f3d57dc6
authored
11 years ago
by
Martin Storsjö
Browse files
Options
Downloads
Patches
Plain Diff
smacker: Free memory properly if the init function fails
Signed-off-by:
Martin Storsjö
<
martin@martin.st
>
parent
0679cec6
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
libavcodec/smacker.c
+23
-21
23 additions, 21 deletions
libavcodec/smacker.c
with
23 additions
and
21 deletions
libavcodec/smacker.c
+
23
−
21
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
)
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment