]> git.sesse.net Git - ffmpeg/blobdiff - libavformat/rmenc.c
avformat/flvenc: check that the codec_tag fits in the available bits
[ffmpeg] / 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));