diff options
author | Aurelien Jacobs <aurel@gnuage.org> | 2011-03-24 01:56:26 +0100 |
---|---|---|
committer | Anton Khirnov <anton@khirnov.net> | 2011-05-12 18:02:28 +0200 |
commit | 89d4c130574c6f2a617c5fde6f9b8a82da7a1e28 (patch) | |
tree | 95d626e053fa67019124cc4a7874b6951dcc27b2 /libavformat/matroskaenc.c | |
parent | 9c569ef7129d2e2972a5caa9cc01899a502b4bbf (diff) | |
download | ffmpeg-89d4c130574c6f2a617c5fde6f9b8a82da7a1e28.tar.gz |
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>
Diffstat (limited to 'libavformat/matroskaenc.c')
-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"); |