mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2024-12-23 12:43:46 +02:00
lavf/utils: fix mem leak
Calling avformat_free_context() right after avformat_alloc_output_context2() leaved option's default values not freed. Options were freed only in av_write_trailer(). Signed-off-by: Lukasz Marek <lukasz.m.luki2@gmail.com> Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
parent
fbf05759e3
commit
e1c48e3593
@ -3546,6 +3546,8 @@ void avformat_free_context(AVFormatContext *s)
|
|||||||
av_opt_free(s);
|
av_opt_free(s);
|
||||||
if (s->iformat && s->iformat->priv_class && s->priv_data)
|
if (s->iformat && s->iformat->priv_class && s->priv_data)
|
||||||
av_opt_free(s->priv_data);
|
av_opt_free(s->priv_data);
|
||||||
|
if (s->oformat && s->oformat->priv_class && s->priv_data)
|
||||||
|
av_opt_free(s->priv_data);
|
||||||
|
|
||||||
for (i = s->nb_streams - 1; i >= 0; i--) {
|
for (i = s->nb_streams - 1; i >= 0; i--) {
|
||||||
ff_free_stream(s, s->streams[i]);
|
ff_free_stream(s, s->streams[i]);
|
||||||
|
Loading…
Reference in New Issue
Block a user