1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2025-01-24 13:56:33 +02:00

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>
(cherry picked from commit 432f291dffb0079bf447b1cdb8802a022298510f)
This commit is contained in:
Andreas Rheinhardt 2020-09-28 18:05:44 +02:00
parent dc4e3b9586
commit 3fc8dc3589

View File

@ -6880,6 +6880,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);