diff options
author | Michael Niedermayer <michael@niedermayer.cc> | 2016-12-22 01:41:49 +0300 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2016-12-22 01:41:49 +0300 |
commit | 9b9e4a71c57261b6b690d9649b8e7a347df6a78b (patch) | |
tree | 485a7e4399289fd7fbceda48451be2117999eb0e /libavformat | |
parent | fd1fcb59dcdb0b1644097a69d0c64084bdc26052 (diff) |
avformat/mpegenc: Check for av_mallocz() failure
Fixes CID1257787
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavformat')
-rw-r--r-- | libavformat/mpegenc.c | 2 |
1 files changed, 2 insertions, 0 deletions
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 = |