lavf/latmenc: Error out for unsupported codecs.

This commit is contained in:
Carl Eugen Hoyos 2017-11-01 02:15:10 +01:00
parent 70c8c8a818
commit 978880c803
1 changed files with 4 additions and 0 deletions

View File

@ -89,6 +89,10 @@ static int latm_write_header(AVFormatContext *s)
if (par->codec_id == AV_CODEC_ID_AAC_LATM)
return 0;
if (par->codec_id != AV_CODEC_ID_AAC && par->codec_id != AV_CODEC_ID_MP4ALS) {
av_log(ctx, AV_LOG_ERROR, "Only AAC, LATM and ALS are supported\n");
return AVERROR_INVALIDDATA;
}
if (par->extradata_size > 0 &&
latm_decode_extradata(ctx, par->extradata, par->extradata_size) < 0)