Commit 89d4c130 authored by Aurelien Jacobs's avatar Aurelien Jacobs Committed by Anton Khirnov

matroskaenc: make sure we don't produce invalid file with no codec ID

Signed-off-by: 's avatarAurelien Jacobs <aurel@gnuage.org>
Signed-off-by: 's avatarAnton Khirnov <anton@khirnov.net>
parent 9c569ef7
......@@ -614,6 +614,10 @@ static int mkv_write_tracks(AVFormatContext *s)
case AVMEDIA_TYPE_SUBTITLE:
put_ebml_uint(pb, MATROSKA_ID_TRACKTYPE, MATROSKA_TRACK_TYPE_SUBTITLE);
if (!native_id) {
av_log(s, AV_LOG_ERROR, "Subtitle codec %d is not supported.\n", codec->codec_id);
return AVERROR(ENOSYS);
}
break;
default:
av_log(s, AV_LOG_ERROR, "Only audio, video, and subtitles are supported for Matroska.\n");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment