Commit 6e245f46 authored by Francois Cartegnie's avatar Francois Cartegnie

demux: mkv: fix use after free (cid #1049107)

GetMainName() can return a pointer to temporary string::
parent 28288a47
......@@ -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 */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment