Browse Source

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 f3dc38a186)
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
tags/n3.2.15
Zhao Zhili Andreas Rheinhardt 5 years ago
parent
commit
bd51c9dfaf
1 changed files with 3 additions and 4 deletions
  1. +3
    -4
      libavformat/mov.c

+ 3
- 4
libavformat/mov.c View File

@@ -5378,10 +5378,9 @@ static int mov_read_close(AVFormatContext *s)
av_aes_ctr_free(sc->cenc.aes_ctr);
}

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++) {


Loading…
Cancel
Save