check av_fifo_alloc return
authorBaptiste Coudurier <baptiste.coudurier@gmail.com>
Thu, 21 May 2009 23:12:41 +0000 (23:12 +0000)
committerBaptiste Coudurier <baptiste.coudurier@gmail.com>
Thu, 21 May 2009 23:12:41 +0000 (23:12 +0000)
Originally committed as revision 18892 to svn://svn.ffmpeg.org/ffmpeg/trunk

libavformat/swfenc.c

index af5da4a..8545ea7 100644 (file)
@@ -193,6 +193,8 @@ static int swf_write_header(AVFormatContext *s)
                 }
                 swf->audio_enc = enc;
                 swf->audio_fifo= av_fifo_alloc(AUDIO_FIFO_SIZE);
                 }
                 swf->audio_enc = enc;
                 swf->audio_fifo= av_fifo_alloc(AUDIO_FIFO_SIZE);
+                if (!swf->audio_fifo)
+                    return AVERROR(ENOMEM);
             } else {
                 av_log(s, AV_LOG_ERROR, "SWF muxer only supports MP3\n");
                 return -1;
             } else {
                 av_log(s, AV_LOG_ERROR, "SWF muxer only supports MP3\n");
                 return -1;