[FFmpeg-devel] [PATCH] avformat/utils: set the AVFormatContext to NULL before return from avformat_free_context

Steven Liu lq at chinaffmpeg.org
Fri Nov 29 07:56:32 EET 2019


Signed-off-by: Steven Liu <lq at chinaffmpeg.org>
---
 libavformat/utils.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/libavformat/utils.c b/libavformat/utils.c
index 8196442dd1..0461aa83ec 100644
--- a/libavformat/utils.c
+++ b/libavformat/utils.c
@@ -4469,6 +4469,7 @@ void avformat_free_context(AVFormatContext *s)
     av_freep(&s->internal);
     av_freep(&s->url);
     av_free(s);
+    s = NULL;
 }
 
 void avformat_close_input(AVFormatContext **ps)
-- 
2.15.1





More information about the ffmpeg-devel mailing list