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