From 9066969713e6a7bad0b76f1936ee60cac456bbe0 Mon Sep 17 00:00:00 2001 From: James Almer Date: Sat, 30 Jan 2021 15:04:24 -0300 Subject: avformat/mux: use av_packet_alloc() to allocate packets Signed-off-by: James Almer --- libavformat/options.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'libavformat/options.c') diff --git a/libavformat/options.c b/libavformat/options.c index 59e0389815..8d7c4fe4cb 100644 --- a/libavformat/options.c +++ b/libavformat/options.c @@ -220,6 +220,12 @@ AVFormatContext *avformat_alloc_context(void) av_free(ic); return NULL; } + internal->pkt = av_packet_alloc(); + if (!internal->pkt) { + av_free(internal); + av_free(ic); + return NULL; + } avformat_get_context_defaults(ic); ic->internal = internal; ic->internal->offset = AV_NOPTS_VALUE; -- cgit v1.2.3