diff options
author | Aurelien Jacobs <aurel@gnuage.org> | 2011-03-24 01:56:26 +0100 |
---|---|---|
committer | Aurelien Jacobs <aurel@gnuage.org> | 2011-03-24 01:56:26 +0100 |
commit | 00dc0206cb5b351a66d7cce77b8a65fabe6ea7da (patch) | |
tree | e587db9351d3bb27fdf9b40c6952ce08353dc571 | |
parent | 75f4d1fadf8d46b95fd225e7cc74e65dac57b7be (diff) | |
download | ffmpeg-00dc0206cb5b351a66d7cce77b8a65fabe6ea7da.tar.gz |
matroskaenc: make sure we don't produce invalid file with no codec ID
Signed-off-by: Aurelien Jacobs <aurel@gnuage.org>
-rw-r--r-- | libavformat/matroskaenc.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/libavformat/matroskaenc.c b/libavformat/matroskaenc.c index c86206bc1b..df192a1cb3 100644 --- a/libavformat/matroskaenc.c +++ b/libavformat/matroskaenc.c @@ -630,6 +630,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_NOTSUPP; + } break; default: av_log(s, AV_LOG_ERROR, "Only audio, video, and subtitles are supported for Matroska.\n"); |