[FFmpeg-cvslog] avformat/isom: don't free extradata before calling ff_get_extradata()

James Almer git at videolan.org
Wed Mar 7 04:42:28 EET 2018


ffmpeg | branch: master | James Almer <jamrial at gmail.com> | Tue Mar  6 23:26:22 2018 -0300| [a43e9cdd442b3ccf50faa32a15b03bdaff278017] | committer: James Almer

avformat/isom: don't free extradata before calling ff_get_extradata()

ff_get_extradata() frees any existing extradata before allocating now,
and using av_free() here leaves a dangling pointer that will result in
a double free.

Fixes a regression since 0ca33b1d4eb2a2a2e78ff3a37f1647917635b0d2.

Tested-by: Michael Niedermayer <michael at niedermayer.cc>
Signed-off-by: James Almer <jamrial at gmail.com>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=a43e9cdd442b3ccf50faa32a15b03bdaff278017
---

 libavformat/isom.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/libavformat/isom.c b/libavformat/isom.c
index 59502a8b3f..2792371c25 100644
--- a/libavformat/isom.c
+++ b/libavformat/isom.c
@@ -526,7 +526,6 @@ FF_ENABLE_DEPRECATION_WARNINGS
         av_log(fc, AV_LOG_TRACE, "Specific MPEG-4 header len=%d\n", len);
         if (!len || (uint64_t)len > (1<<30))
             return AVERROR_INVALIDDATA;
-        av_free(st->codecpar->extradata);
         if ((ret = ff_get_extradata(fc, st->codecpar, pb, len)) < 0)
             return ret;
         if (st->codecpar->codec_id == AV_CODEC_ID_AAC) {



More information about the ffmpeg-cvslog mailing list