[FFmpeg-devel] [PATCH v2] avformat/movenc: Don't free AVCodecParameters manually

Andreas Rheinhardt andreas.rheinhardt at gmail.com
Mon Sep 28 14:36:27 EEST 2020


Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt at gmail.com>
---
Sorry, I missed that my tree is dirty before sending the last patch.

 libavformat/movenc.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/libavformat/movenc.c b/libavformat/movenc.c
index 20768cd45f..63adae5e0a 100644
--- a/libavformat/movenc.c
+++ b/libavformat/movenc.c
@@ -6255,9 +6255,7 @@ static void mov_free(AVFormatContext *s)
     int i;
 
     if (mov->chapter_track) {
-        if (mov->tracks[mov->chapter_track].par)
-            av_freep(&mov->tracks[mov->chapter_track].par->extradata);
-        av_freep(&mov->tracks[mov->chapter_track].par);
+        avcodec_parameters_free(&mov->tracks[mov->chapter_track].par);
     }
 
     for (i = 0; i < mov->nb_streams; i++) {
-- 
2.25.1



More information about the ffmpeg-devel mailing list