diff options
author | Aurelien Jacobs <aurel@gnuage.org> | 2011-03-24 03:56:26 +0300 |
---|---|---|
committer | Anton Khirnov <anton@khirnov.net> | 2011-05-12 20:02:28 +0400 |
commit | 89d4c130574c6f2a617c5fde6f9b8a82da7a1e28 (patch) | |
tree | 95d626e053fa67019124cc4a7874b6951dcc27b2 | |
parent | 9c569ef7129d2e2972a5caa9cc01899a502b4bbf (diff) |
matroskaenc: make sure we don't produce invalid file with no codec ID
Signed-off-by: Aurelien Jacobs <aurel@gnuage.org>
Signed-off-by: Anton Khirnov <anton@khirnov.net>
-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 4aa4cafd4c..1bbabc9ff4 100644 --- a/libavformat/matroskaenc.c +++ b/libavformat/matroskaenc.c @@ -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"); |