From 9b9e4a71c57261b6b690d9649b8e7a347df6a78b Mon Sep 17 00:00:00 2001 From: Michael Niedermayer Date: Wed, 21 Dec 2016 23:41:49 +0100 Subject: [PATCH] avformat/mpegenc: Check for av_mallocz() failure Fixes CID1257787 Signed-off-by: Michael Niedermayer --- libavformat/mpegenc.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/libavformat/mpegenc.c b/libavformat/mpegenc.c index 878fa6381f..c77c3dfe41 100644 --- a/libavformat/mpegenc.c +++ b/libavformat/mpegenc.c @@ -1146,6 +1146,8 @@ static int mpeg_mux_write_packet(AVFormatContext *ctx, AVPacket *pkt) stream->next_packet = &stream->premux_packet; *stream->next_packet = pkt_desc = av_mallocz(sizeof(PacketDesc)); + if (!pkt_desc) + return AVERROR(ENOMEM); pkt_desc->pts = pts; pkt_desc->dts = dts; pkt_desc->unwritten_size =