*****************************************************************************/
decoder_synchro_t * decoder_SynchroInit( decoder_t *p_dec, int i_frame_rate )
{
- decoder_synchro_t * p_synchro = malloc( sizeof(*p_synchro) );
- if ( p_synchro == NULL )
+ decoder_synchro_t * p_synchro = calloc( 1, sizeof(*p_synchro) );
+ if( !p_synchro )
return NULL;
- memset( p_synchro, 0, sizeof(*p_synchro) );
p_synchro->p_dec = p_dec;
p_synchro->b_no_skip = !config_GetInt( p_dec, "skip-frames" );
}
if( b_add )
{
- vlc_epg_event_t *p_copy = malloc( sizeof(vlc_epg_event_t) );
+ vlc_epg_event_t *p_copy = calloc( 1, sizeof(vlc_epg_event_t) );
if( !p_copy )
break;
- memset( p_copy, 0, sizeof(vlc_epg_event_t) );
p_copy->i_start = p_evt->i_start;
p_copy->i_duration = p_evt->i_duration;
p_copy->psz_name = p_evt->psz_name ? strdup( p_evt->psz_name ) : NULL;
*/
image_handler_t *__image_HandlerCreate( vlc_object_t *p_this )
{
- image_handler_t *p_image = malloc( sizeof(image_handler_t) );
+ image_handler_t *p_image = calloc( 1, sizeof(image_handler_t) );
+ if( !p_image )
+ return NULL;
- memset( p_image, 0, sizeof(image_handler_t) );
p_image->p_parent = p_this;
p_image->pf_read = ImageRead;
input_stats_t *stats_NewInputStats( input_thread_t *p_input )
{
(void)p_input;
- input_stats_t *p_stats = malloc( sizeof(input_stats_t) );
-
+ input_stats_t *p_stats = calloc( 1, sizeof(input_stats_t) );
if( !p_stats )
return NULL;
- memset( p_stats, 0, sizeof(*p_stats) );
vlc_mutex_init( &p_stats->lock );
stats_ReinitInputStats( p_stats );
{
assert (module != NULL);
- module_t *submodule = malloc (sizeof (*submodule));
- if (submodule == NULL)
+ module_t *submodule = calloc( 1, sizeof(*submodule) );
+ if( !submodule )
return NULL;
- memset (submodule, 0, sizeof (*submodule));
vlc_gc_init (submodule, vlc_submodule_destruct);
submodule->next = module->submodule;
REMOVE_ELEM( p_detach->pp_children, p_detach->i_children, j );
/* If j < i_newpos, we are moving the element from the top to the
- * down of the playlist. So when removing the element we change have
+ * down of the playlist. So when removing the element we have
* to change the position as we loose one element
*/
if( j < i_newpos )
assert (p_method == &sap_method);
(void) p_method;
- session_descriptor_t *p_session = malloc (sizeof (*p_session));
-
- if (!p_session)
+ session_descriptor_t *p_session = calloc( 1, sizeof (*p_session) );
+ if( !p_session )
return NULL;
- memset( p_session, 0, sizeof( *p_session ) );
p_session->psz_sdp = strdup( psz_sdp );
/* GRUIK. We should not convert back-and-forth from string to numbers */
*****************************************************************************/
picture_t *picture_New( vlc_fourcc_t i_chroma, int i_width, int i_height, int i_aspect )
{
- picture_t *p_picture = malloc( sizeof(*p_picture) );
-
+ picture_t *p_picture = calloc( 1, sizeof(*p_picture) );
if( !p_picture )
return NULL;
- memset( p_picture, 0, sizeof(*p_picture) );
if( __vout_AllocatePicture( NULL, p_picture,
i_chroma, i_width, i_height, i_aspect ) )
{