vlc | branch: master | Francois Cartegnie <[email protected]> | Sat Nov 30 21:10:51 2013 +0100| [6e245f46d63e407be6fff99f30ea9dd3d734c8e8] | committer: Francois Cartegnie
demux: mkv: fix use after free (cid #1049107) GetMainName() can return a pointer to temporary string:: > http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=6e245f46d63e407be6fff99f30ea9dd3d734c8e8 --- modules/demux/mkv/demux.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/modules/demux/mkv/demux.cpp b/modules/demux/mkv/demux.cpp index be20476..a0e8e89 100644 --- a/modules/demux/mkv/demux.cpp +++ b/modules/demux/mkv/demux.cpp @@ -684,9 +684,8 @@ bool demux_sys_t::PreloadLinked() // TODO use a name for each edition, let the TITLE deal with a codec name if ( p_title->psz_name == NULL ) { - const char* psz_tmp = p_ved->GetMainName().c_str(); - if( *psz_tmp != '\0' ) - p_title->psz_name = strdup( psz_tmp ); + if( p_ved->GetMainName().length() ) + p_title->psz_name = strdup( p_ved->GetMainName().c_str() ); else { /* Check in tags if the edition has a name */ _______________________________________________ vlc-commits mailing list [email protected] https://mailman.videolan.org/listinfo/vlc-commits
