diff --git a/libavformat/mov.c b/libavformat/mov.c index e01fe1a137..c9740bfa2b 100644 --- a/libavformat/mov.c +++ b/libavformat/mov.c @@ -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++) {