diff options
author | Paul B Mahol <onemda@gmail.com> | 2012-10-20 22:16:13 +0000 |
---|---|---|
committer | Paul B Mahol <onemda@gmail.com> | 2012-10-22 08:07:09 +0000 |
commit | cb0add3ce961dfe8076e300564a1f2378ae90b6c (patch) | |
tree | af431697917fa75623fd52aa4adf5a98ee4c1ddf | |
parent | 2d11ee4bfc7cf8c04e40782fc73d72a3d4f0e246 (diff) | |
download | ffmpeg-cb0add3ce961dfe8076e300564a1f2378ae90b6c.tar.gz |
lavf/flacenc: disallow creation of invalid files with -c copy
Signed-off-by: Paul B Mahol <onemda@gmail.com>
-rw-r--r-- | libavformat/flacenc.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/libavformat/flacenc.c b/libavformat/flacenc.c index 8c270eeb14..b625278022 100644 --- a/libavformat/flacenc.c +++ b/libavformat/flacenc.c @@ -69,6 +69,15 @@ static int flac_write_header(struct AVFormatContext *s) int ret; AVCodecContext *codec = s->streams[0]->codec; + if (s->nb_streams > 1) { + av_log(s, AV_LOG_ERROR, "only one stream is supported\n"); + return AVERROR(EINVAL); + } + if (codec->codec_id != AV_CODEC_ID_FLAC) { + av_log(s, AV_LOG_ERROR, "unsupported codec\n"); + return AVERROR(EINVAL); + } + ret = ff_flac_write_header(s->pb, codec, 0); if (ret) return ret; |