aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZhao Zhili <quinkblack@foxmail.com>2020-06-28 11:15:39 +0800
committerAndreas Rheinhardt <andreas.rheinhardt@gmail.com>2020-07-01 19:02:29 +0200
commit143e2d0d6653426b871ff5802a1d558d60f574fe (patch)
tree6b0fff068831c42f818acd023eafa50f43b74254
parent7c1ad9d1514a16d56cb0803787b62694fd9b6b24 (diff)
downloadffmpeg-143e2d0d6653426b871ff5802a1d558d60f574fe.tar.gz
avformat/mov: fix memleaks
Fix two cases of memleaks: 1. The leak of dv_demux 2. The leak of dv_fctx upon dv_demux allocate failure Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com> (cherry picked from commit f3dc38a186b2326ce03e50969897ea703817ddb0) Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
-rw-r--r--libavformat/mov.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/libavformat/mov.c b/libavformat/mov.c
index 54c0fd7020..66db318ec3 100644
--- a/libavformat/mov.c
+++ b/libavformat/mov.c
@@ -7391,10 +7391,9 @@ static int mov_read_close(AVFormatContext *s)
av_freep(&sc->coll);
}
- if (mov->dv_demux) {
- avformat_free_context(mov->dv_fctx);
- mov->dv_fctx = NULL;
- }
+ av_freep(&mov->dv_demux);
+ avformat_free_context(mov->dv_fctx);
+ mov->dv_fctx = NULL;
if (mov->meta_keys) {
for (i = 1; i < mov->meta_keys_count; i++) {