[FFmpeg-cvslog] matroskaenc: make sure we don't produce invalid file with no codec ID
Aurelien Jacobs
git at videolan.org
Thu Mar 24 01:57:50 CET 2011
ffmpeg | branch: master | Aurelien Jacobs <aurel at gnuage.org> | Thu Mar 24 01:56:26 2011 +0100| [00dc0206cb5b351a66d7cce77b8a65fabe6ea7da] | committer: Aurelien Jacobs
matroskaenc: make sure we don't produce invalid file with no codec ID
Signed-off-by: Aurelien Jacobs <aurel at gnuage.org>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=00dc0206cb5b351a66d7cce77b8a65fabe6ea7da
---
libavformat/matroskaenc.c | 4 ++++
1 files changed, 4 insertions(+), 0 deletions(-)
diff --git a/libavformat/matroskaenc.c b/libavformat/matroskaenc.c
index c86206b..df192a1 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");
More information about the ffmpeg-cvslog
mailing list