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

item: fix undefined zero-size array

parent 2497622d
......@@ -772,22 +772,27 @@ void input_item_SetEpgOffline( input_item_t *p_item )
#ifdef EPG_DEBUG
vlc_mutex_lock( &p_item->lock );
const int i_epg_info = p_item->i_epg;
char *ppsz_epg_info[i_epg_info];
for( int i = 0; i < p_item->i_epg; i++ )
if( i_epg_info > 0 )
{
const vlc_epg_t *p_epg = p_item->pp_epg[i];
if( asprintf( &ppsz_epg_info[i], "EPG %s", p_epg->psz_name ? p_epg->psz_name : "unknown" ) < 0 )
ppsz_epg_info[i] = NULL;
}
vlc_mutex_unlock( &p_item->lock );
char *ppsz_epg_info[i_epg_info];
for( int i = 0; i < p_item->i_epg; i++ )
{
const vlc_epg_t *p_epg = p_item->pp_epg[i];
if( asprintf( &ppsz_epg_info[i], "EPG %s", p_epg->psz_name ? p_epg->psz_name : "unknown" ) < 0 )
ppsz_epg_info[i] = NULL;
}
vlc_mutex_unlock( &p_item->lock );
for( int i = 0; i < i_epg_info; i++ )
{
if( !ppsz_epg_info[i] )
continue;
input_item_DelInfo( p_item, ppsz_epg_info[i], NULL );
free( ppsz_epg_info[i] );
for( int i = 0; i < i_epg_info; i++ )
{
if( !ppsz_epg_info[i] )
continue;
input_item_DelInfo( p_item, ppsz_epg_info[i], NULL );
free( ppsz_epg_info[i] );
}
}
else
vlc_mutex_unlock( &p_item->lock );
#endif
vlc_event_t event = { .type = vlc_InputItemInfoChanged, };
......
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