Commit 17972559 authored by Laurent Aimar's avatar Laurent Aimar

Fixed potential segfault on error with mkv demuxer.

parent 3d356aef
...@@ -592,6 +592,8 @@ void demux_sys_t::InitUi() ...@@ -592,6 +592,8 @@ void demux_sys_t::InitUi()
/* FIXME hack hack hack hack FIXME */ /* FIXME hack hack hack hack FIXME */
/* Get p_input and create variable */ /* Get p_input and create variable */
p_input = demux_GetParentInput( &demuxer ); p_input = demux_GetParentInput( &demuxer );
if( p_input )
{
var_Create( p_input, "x-start", VLC_VAR_INTEGER ); var_Create( p_input, "x-start", VLC_VAR_INTEGER );
var_Create( p_input, "y-start", VLC_VAR_INTEGER ); var_Create( p_input, "y-start", VLC_VAR_INTEGER );
var_Create( p_input, "x-end", VLC_VAR_INTEGER ); var_Create( p_input, "x-end", VLC_VAR_INTEGER );
...@@ -600,6 +602,7 @@ void demux_sys_t::InitUi() ...@@ -600,6 +602,7 @@ void demux_sys_t::InitUi()
var_Create( p_input, "menu-palette", VLC_VAR_ADDRESS ); var_Create( p_input, "menu-palette", VLC_VAR_ADDRESS );
var_Create( p_input, "highlight", VLC_VAR_BOOL ); var_Create( p_input, "highlight", VLC_VAR_BOOL );
var_Create( p_input, "highlight-mutex", VLC_VAR_MUTEX ); var_Create( p_input, "highlight-mutex", VLC_VAR_MUTEX );
}
/* Now create our event thread catcher */ /* Now create our event thread catcher */
p_ev = new event_thread_t(&demuxer); p_ev = new event_thread_t(&demuxer);
...@@ -610,6 +613,8 @@ void demux_sys_t::CleanUi() ...@@ -610,6 +613,8 @@ void demux_sys_t::CleanUi()
delete p_ev; delete p_ev;
p_ev = NULL; p_ev = NULL;
if( p_input )
{
var_Destroy( p_input, "highlight-mutex" ); var_Destroy( p_input, "highlight-mutex" );
var_Destroy( p_input, "highlight" ); var_Destroy( p_input, "highlight" );
var_Destroy( p_input, "x-start" ); var_Destroy( p_input, "x-start" );
...@@ -620,6 +625,7 @@ void demux_sys_t::CleanUi() ...@@ -620,6 +625,7 @@ void demux_sys_t::CleanUi()
var_Destroy( p_input, "menu-palette" ); var_Destroy( p_input, "menu-palette" );
vlc_object_release( p_input ); vlc_object_release( p_input );
}
msg_Dbg( &demuxer, "Stopping the UI Hook" ); msg_Dbg( &demuxer, "Stopping the UI Hook" );
} }
......
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