]> git.sesse.net Git - ffmpeg/commitdiff
avformat/rmenc: Check for av_malloc() failure
authorMichael Niedermayer <michaelni@gmx.at>
Sun, 22 Feb 2015 16:29:14 +0000 (17:29 +0100)
committerMichael Niedermayer <michaelni@gmx.at>
Sun, 22 Feb 2015 16:47:40 +0000 (17:47 +0100)
Fixes CID1257832

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libavformat/rmenc.c

index d019e1beabd55c1515fe25853e60c2ce6abe7a7c..838388f30d1778f8eb13d2423be37d43328d4920 100644 (file)
@@ -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));