[FFmpeg-cvslog] avformat/mpegenc: Check for av_mallocz() failure
Michael Niedermayer
git at videolan.org
Thu Dec 22 01:30:59 EET 2016
ffmpeg | branch: master | Michael Niedermayer <michael at niedermayer.cc> | Wed Dec 21 23:41:49 2016 +0100| [9b9e4a71c57261b6b690d9649b8e7a347df6a78b] | committer: Michael Niedermayer
avformat/mpegenc: Check for av_mallocz() failure
Fixes CID1257787
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=9b9e4a71c57261b6b690d9649b8e7a347df6a78b
---
libavformat/mpegenc.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/libavformat/mpegenc.c b/libavformat/mpegenc.c
index 878fa63..c77c3df 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 =
More information about the ffmpeg-cvslog
mailing list