Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
videolan
vlc
Commits
15c1b323
Commit
15c1b323
authored
Sep 13, 2014
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avcodec/encoder: fix alloc/free of context
parent
fbd4154e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
1 deletion
+8
-1
modules/codec/avcodec/encoder.c
modules/codec/avcodec/encoder.c
+8
-1
No files found.
modules/codec/avcodec/encoder.c
View file @
15c1b323
...
...
@@ -352,6 +352,11 @@ int OpenEncoder( vlc_object_t *p_this )
p_sys
->
i_buffer_out
=
0
;
p_context
=
avcodec_alloc_context3
(
p_codec
);
if
(
unlikely
(
p_context
==
NULL
)
)
{
free
(
p_sys
);
return
VLC_ENOMEM
;
}
p_sys
->
p_context
=
p_context
;
p_sys
->
p_context
->
codec_id
=
p_sys
->
p_codec
->
id
;
p_context
->
thread_type
=
0
;
...
...
@@ -457,6 +462,7 @@ int OpenEncoder( vlc_object_t *p_this )
{
msg_Warn
(
p_enc
,
"invalid size %ix%i"
,
p_enc
->
fmt_in
.
video
.
i_visible_width
,
p_enc
->
fmt_in
.
video
.
i_visible_height
);
avcodec_free_context
(
&
p_context
);
free
(
p_sys
);
return
VLC_EGENERIC
;
}
...
...
@@ -1005,6 +1011,7 @@ error:
free
(
p_enc
->
fmt_out
.
p_extra
);
av_free
(
p_sys
->
p_buffer
);
av_free
(
p_sys
->
p_interleave_buf
);
avcodec_free_context
(
&
p_context
);
free
(
p_sys
);
return
VLC_ENOMEM
;
}
...
...
@@ -1404,7 +1411,7 @@ void CloseEncoder( vlc_object_t *p_this )
vlc_avcodec_lock
();
avcodec_close
(
p_sys
->
p_context
);
vlc_avcodec_unlock
();
av
_free
(
p_sys
->
p_context
);
av
codec_free_context
(
&
p_sys
->
p_context
);
av_free
(
p_sys
->
p_interleave_buf
);
...
...
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