avformat_free_context() expects AVFormatContext->internal to not be NULL.

Signed-off-by: James Almer <jamr...@gmail.com>
---
Alternatively we could check for internal != NULL in avformat_free_context()
before dereferencing it, but i don't think it makes sense calling that function
at all if the AVFormatContext wasn't even fully allocated to begin with.

 libavformat/options.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavformat/options.c b/libavformat/options.c
index c188c23506..9a6deed0df 100644
--- a/libavformat/options.c
+++ b/libavformat/options.c
@@ -150,7 +150,7 @@ AVFormatContext *avformat_alloc_context(void)
 
     ic->internal = av_mallocz(sizeof(*ic->internal));
     if (!ic->internal) {
-        avformat_free_context(ic);
+        av_free(ic);
         return NULL;
     }
     ic->internal->offset = AV_NOPTS_VALUE;
-- 
2.23.0

_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".

Reply via email to