]> git.sesse.net Git - vlc/commitdiff
MKV: fix SIGSEGV when codec id is empty
authorJean-Baptiste Kempf <jb@videolan.org>
Sun, 6 Oct 2013 15:53:44 +0000 (17:53 +0200)
committerJean-Baptiste Kempf <jb@videolan.org>
Sun, 6 Oct 2013 15:53:44 +0000 (17:53 +0200)
modules/demux/mkv/matroska_segment_parse.cpp

index bc1ba67309bd76c401b41bfc5f194af2a78f028f..3b058de8c990b78c2a2e43fc648ace7e8b84128e 100644 (file)
@@ -1263,6 +1263,14 @@ void matroska_segment_c::ParseCluster( bool b_update_start_time )
 int32_t matroska_segment_c::TrackInit( mkv_track_t * p_tk )
 {
     es_format_t *p_fmt = &p_tk->fmt;
+
+    if( p_tk->psz_codec == NULL )
+    {
+        msg_Err( &sys.demuxer, "Empty codec id" );
+        p_tk->fmt.i_codec = VLC_FOURCC( 'u', 'n', 'd', 'f' );
+        return 0;
+    }
+
     if( !strcmp( p_tk->psz_codec, "V_MS/VFW/FOURCC" ) )
     {
         if( p_tk->i_extra_data < (int)sizeof( VLC_BITMAPINFOHEADER ) )