diff options
author | Andreas Rheinhardt <andreas.rheinhardt@gmail.com> | 2020-09-28 18:05:44 +0200 |
---|---|---|
committer | Andreas Rheinhardt <andreas.rheinhardt@gmail.com> | 2020-10-05 00:49:11 +0200 |
commit | 432f291dffb0079bf447b1cdb8802a022298510f (patch) | |
tree | c0952ddcb0e630f66d1b0a68a064b964fbbdaa26 /libavformat | |
parent | 0336bbf68a047854308e812fc21f45e00aff6ed0 (diff) | |
download | ffmpeg-432f291dffb0079bf447b1cdb8802a022298510f.tar.gz |
avformat/movenc: Free old vos_data before overwriting it
Otherwise the old data leaks whenever extradata needs to be rewritten
(e.g. when encoding FLAC with our encoder that sends an updated
extradata packet at the end).
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
Diffstat (limited to 'libavformat')
-rw-r--r-- | libavformat/movenc.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/libavformat/movenc.c b/libavformat/movenc.c index 7256eb2a0f..6ed93d89ea 100644 --- a/libavformat/movenc.c +++ b/libavformat/movenc.c @@ -6983,6 +6983,7 @@ static int mov_write_trailer(AVFormatContext *s) AVCodecParameters *par = track->par; track->vos_len = par->extradata_size; + av_freep(&track->vos_data); track->vos_data = av_malloc(track->vos_len + AV_INPUT_BUFFER_PADDING_SIZE); if (!track->vos_data) return AVERROR(ENOMEM); |