diff options
author | Zhao Zhili <quinkblack@foxmail.com> | 2020-06-28 06:15:39 +0300 |
---|---|---|
committer | Andreas Rheinhardt <andreas.rheinhardt@gmail.com> | 2020-07-01 17:43:20 +0300 |
commit | 7db4f36291464ba81c75accd99c0279e6892463a (patch) | |
tree | 4d82715267129590a965b945546f22659e6b34d5 /libavformat | |
parent | af773c60d6e5b375a6c38a135c6aacaf26481b29 (diff) |
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>
Diffstat (limited to 'libavformat')
-rw-r--r-- | libavformat/mov.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/libavformat/mov.c b/libavformat/mov.c index 60538d4f66..cc56c8792a 100644 --- a/libavformat/mov.c +++ b/libavformat/mov.c @@ -4372,10 +4372,9 @@ static int mov_read_close(AVFormatContext *s) av_freep(&sc->display_matrix); } - 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; av_freep(&mov->trex_data); av_freep(&mov->bitrates); |