1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-11-26 19:01:44 +02:00

lavf/cafenc: Only allow mono and stereo for Opus.

Found-by: James Almer
This commit is contained in:
Carl Eugen Hoyos 2017-10-17 23:00:07 +02:00
parent a6cfc287a0
commit d180fce6c7

View File

@ -123,6 +123,11 @@ static int caf_write_header(AVFormatContext *s)
return AVERROR_PATCHWELCOME;
}
if (par->codec_id == AV_CODEC_ID_OPUS && par->channels > 2) {
av_log(s, AV_LOG_ERROR, "Only mono and stereo are supported for Opus\n");
return AVERROR_INVALIDDATA;
}
if (!codec_tag) {
av_log(s, AV_LOG_ERROR, "unsupported codec\n");
return AVERROR_INVALIDDATA;