mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-03-23 04:24:35 +02:00
lavf/flacenc: disallow creation of invalid files with -c copy
Signed-off-by: Paul B Mahol <onemda@gmail.com>
This commit is contained in:
parent
2d11ee4bfc
commit
cb0add3ce9
@ -69,6 +69,15 @@ static int flac_write_header(struct AVFormatContext *s)
|
|||||||
int ret;
|
int ret;
|
||||||
AVCodecContext *codec = s->streams[0]->codec;
|
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);
|
ret = ff_flac_write_header(s->pb, codec, 0);
|
||||||
if (ret)
|
if (ret)
|
||||||
return ret;
|
return ret;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user