diff options
author | James Almer <jamrial@gmail.com> | 2021-01-31 13:05:49 -0300 |
---|---|---|
committer | James Almer <jamrial@gmail.com> | 2021-03-17 15:06:48 -0300 |
commit | 01f4d33b4195c4d95642ac3e548b8d9250b7de1f (patch) | |
tree | 17afd929420a654aa95255d417574c22440902b0 /libavformat/options.c | |
parent | 9066969713e6a7bad0b76f1936ee60cac456bbe0 (diff) | |
download | ffmpeg-01f4d33b4195c4d95642ac3e548b8d9250b7de1f.tar.gz |
avformat/utils: use av_packet_alloc() to allocate packets
Signed-off-by: James Almer <jamrial@gmail.com>
Diffstat (limited to 'libavformat/options.c')
-rw-r--r-- | libavformat/options.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/libavformat/options.c b/libavformat/options.c index 8d7c4fe4cb..07403b533e 100644 --- a/libavformat/options.c +++ b/libavformat/options.c @@ -221,7 +221,10 @@ AVFormatContext *avformat_alloc_context(void) return NULL; } internal->pkt = av_packet_alloc(); - if (!internal->pkt) { + internal->parse_pkt = av_packet_alloc(); + if (!internal->pkt || !internal->parse_pkt) { + av_packet_free(&internal->pkt); + av_packet_free(&internal->parse_pkt); av_free(internal); av_free(ic); return NULL; |