[FFmpeg-cvslog] avformat/rmenc: Check for av_malloc() failure
Michael Niedermayer
git at videolan.org
Sun Feb 22 17:49:56 CET 2015
ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Sun Feb 22 17:29:14 2015 +0100| [56838103020385020469d1da076f0e4a6cbe15e5] | committer: Michael Niedermayer
avformat/rmenc: Check for av_malloc() failure
Fixes CID1257832
Signed-off-by: Michael Niedermayer <michaelni at gmx.at>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=56838103020385020469d1da076f0e4a6cbe15e5
---
libavformat/rmenc.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/libavformat/rmenc.c b/libavformat/rmenc.c
index d019e1b..838388f 100644
--- a/libavformat/rmenc.c
+++ b/libavformat/rmenc.c
@@ -364,6 +364,8 @@ static int rm_write_audio(AVFormatContext *s, const uint8_t *buf, int size, int
/* XXX: suppress this malloc */
buf1 = av_malloc(size * sizeof(uint8_t));
+ if (!buf1)
+ return AVERROR(ENOMEM);
write_packet_header(s, stream, size, !!(flags & AV_PKT_FLAG_KEY));
More information about the ffmpeg-cvslog
mailing list