int BufferDestroy( buffer_t *p_buffer )
{
- if( p_buffer->p_memory != NULL )
- {
- free( p_buffer->p_memory );
- }
+ free( p_buffer->p_memory );
p_buffer->p_memory = NULL;
p_buffer->p_begin = NULL;
overlay_t *OverlayCreate( void )
{
- overlay_t *p_ovl = malloc( sizeof( overlay_t ) );
+ overlay_t *p_ovl = calloc( 1, sizeof( overlay_t ) );
if( p_ovl == NULL )
return NULL;
- memset( p_ovl, 0, sizeof( overlay_t ) );
p_ovl->i_x = p_ovl->i_y = 0;
p_ovl->i_alpha = 0xFF;
int OverlayDestroy( overlay_t *p_ovl )
{
- if( p_ovl->data.p_text != NULL )
- free( p_ovl->data.p_text );
+ free( p_ovl->data.p_text );
text_style_Delete( p_ovl->p_fontstyle );
return VLC_SUCCESS;
int ListInit( list_t *p_list )
{
- p_list->pp_head = malloc( 16 * sizeof( overlay_t * ) );
+ p_list->pp_head = calloc( 16, sizeof( overlay_t * ) );
if( p_list->pp_head == NULL )
return VLC_ENOMEM;
p_list->pp_tail = p_list->pp_head + 16;
- memset( p_list->pp_head, 0, 16 * sizeof( overlay_t * ) );
-
return VLC_SUCCESS;
}