aboutsummaryrefslogtreecommitdiff
path: root/libavformat/swfenc.c
diff options
context:
space:
mode:
authorMichael Niedermayer2012-10-10 13:18:05 +0200
committerMichael Niedermayer2012-10-10 13:18:05 +0200
commit50b5477616c8f6001a575fb953db45dd9a14662c (patch)
tree4af87567da08f040334d6ac938528c14b116825c /libavformat/swfenc.c
parenteadba3e94daac2f48fd9ce7c9fdf5a562d3274ed (diff)
parentb94e4acb4874843e914fd3cb8e089aff0756bb4a (diff)
Merge commit 'b94e4acb4874843e914fd3cb8e089aff0756bb4a'
* commit 'b94e4acb4874843e914fd3cb8e089aff0756bb4a': cmdutils_read_file: increment *size after writing the trailing \0 af_resample: unref out_buf when avresample_convert returns 0 af_amix: prevent memory leak on error path vc1dec: prevent memory leak in error path vc1dec: prevent memory leak on av_realloc error af_channelmap: free old extended_data on reallocation avconv: simplify memory allocation in copy_chapters matroskaenc: check cue point validity before reallocation swfenc: error out for more than 1 audio or video stream build: link test programs only against static libs Conflicts: ffmpeg_opt.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavformat/swfenc.c')
-rw-r--r--libavformat/swfenc.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/libavformat/swfenc.c b/libavformat/swfenc.c
index 4a5be12783..b55f1a9ce4 100644
--- a/libavformat/swfenc.c
+++ b/libavformat/swfenc.c
@@ -187,6 +187,10 @@ static int swf_write_header(AVFormatContext *s)
for(i=0;i<s->nb_streams;i++) {
AVCodecContext *enc = s->streams[i]->codec;
if (enc->codec_type == AVMEDIA_TYPE_AUDIO) {
+ if (swf->audio_enc) {
+ av_log(s, AV_LOG_ERROR, "SWF muxer only supports 1 audio stream\n");
+ return AVERROR_INVALIDDATA;
+ }
if (enc->codec_id == AV_CODEC_ID_MP3) {
swf->audio_enc = enc;
swf->audio_fifo= av_fifo_alloc(AUDIO_FIFO_SIZE);
@@ -197,6 +201,10 @@ static int swf_write_header(AVFormatContext *s)
return -1;
}
} else {
+ if (swf->video_enc) {
+ av_log(s, AV_LOG_ERROR, "SWF muxer only supports 1 video stream\n");
+ return AVERROR_INVALIDDATA;
+ }
if (enc->codec_id == AV_CODEC_ID_VP6F ||
enc->codec_id == AV_CODEC_ID_FLV1 ||
enc->codec_id == AV_CODEC_ID_MJPEG) {