Commit 246d92bc authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

input: fix forward NULL

(cherry picked from commit dd6170364ffa7a6cc2248f2ef8b1f98e25f95589)
parent 60b89fc3
......@@ -530,28 +530,34 @@ static void UpdateBookmarksOption( input_thread_t *p_input )
}
char *psz_value = malloc( i_len + p_input->p->i_bookmark + 1 );
char *psz_next = psz_value;
psz_next += sprintf( psz_next, "bookmarks=" );
for( int i = 0; i < p_input->p->i_bookmark && psz_value != NULL; i++ )
if( psz_value != NULL )
{
const seekpoint_t *p_bookmark = p_input->p->pp_bookmark[i];
strcpy( psz_value, "bookmarks=" );
psz_next += sprintf( psz_next, psz_format,
p_bookmark->psz_name,
p_bookmark->i_byte_offset,
p_bookmark->i_time_offset/1000000 );
char *psz_next = psz_value + strlen( "bookmarks" );
if( i < p_input->p->i_bookmark - 1)
*psz_next++ = ',';
}
vlc_mutex_unlock( &p_input->p->p_item->lock );
for( int i = 0; i < p_input->p->i_bookmark && psz_value != NULL; i++ )
{
const seekpoint_t *p_bookmark = p_input->p->pp_bookmark[i];
if( psz_value )
input_item_AddOption( p_input->p->p_item, psz_value, VLC_INPUT_OPTION_UNIQUE );
psz_next += sprintf( psz_next, psz_format,
p_bookmark->psz_name,
p_bookmark->i_byte_offset,
p_bookmark->i_time_offset/1000000 );
free( psz_value );
if( i < p_input->p->i_bookmark - 1)
*psz_next++ = ',';
}
}
vlc_mutex_unlock( &p_input->p->p_item->lock );
if( psz_value != NULL )
{
input_item_AddOption( p_input->p->p_item, psz_value,
VLC_INPUT_OPTION_UNIQUE );
free( psz_value );
}
input_SendEventBookmark( p_input );
}
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