summaryrefslogtreecommitdiff
path: root/libavformat/rmenc.c
diff options
context:
space:
mode:
authorFederico Tomassetti <federico@tomassetti.me>2015-03-21 10:45:00 +0000
committerLuca Barbato <lu_zero@gentoo.org>2015-03-21 23:18:14 +0100
commitd3aa307da076e8820298b2c59ec5d6ff01a5e374 (patch)
tree145bc61c29b657c5c8947de16865746419105532 /libavformat/rmenc.c
parent7ebb3022297aa00afda6800105684b8303f2608e (diff)
rmenc: Check memory allocation
Bug-Id: CID 1257832 Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
Diffstat (limited to 'libavformat/rmenc.c')
-rw-r--r--libavformat/rmenc.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/libavformat/rmenc.c b/libavformat/rmenc.c
index 5d8f001931..863a866d1e 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));