[FFmpeg-cvslog] rmenc: Check memory allocation
Federico Tomassetti
git at videolan.org
Sun Mar 22 04:01:10 CET 2015
ffmpeg | branch: master | Federico Tomassetti <federico at tomassetti.me> | Sat Mar 21 10:45:00 2015 +0000| [d3aa307da076e8820298b2c59ec5d6ff01a5e374] | committer: Luca Barbato
rmenc: Check memory allocation
Bug-Id: CID 1257832
Signed-off-by: Luca Barbato <lu_zero at gentoo.org>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=d3aa307da076e8820298b2c59ec5d6ff01a5e374
---
libavformat/rmenc.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/libavformat/rmenc.c b/libavformat/rmenc.c
index 5d8f001..863a866 100644
--- a/libavformat/rmenc.c
+++ b/libavformat/rmenc.c
@@ -363,6 +363,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