Commit f7e6bd53 authored by Thomas Guillem's avatar Thomas Guillem

freetype: use vlc_alloc helper

parent c48c48ea
......@@ -505,7 +505,7 @@ static char *DWrite_Fallback( filter_t *p_filter, const char *psz_family,
goto done;
}
pwsz_buffer = ( wchar_t * ) malloc( ( i_string_length + 1 ) * sizeof( *pwsz_buffer ) );
pwsz_buffer = ( wchar_t * ) vlc_alloc( ( i_string_length + 1 ), sizeof( *pwsz_buffer ) );
if( unlikely( !pwsz_buffer ) )
goto done;
......
......@@ -310,7 +310,7 @@ static TCHAR *GetFullEnglishName( const ENUMLOGFONTEX *lpelfe )
goto done;
int i_length_in_wchars = i_name_length / 2;
wchar_t *psz_name = malloc( ( i_length_in_wchars + 1 ) * sizeof( *psz_name ) );
wchar_t *psz_name = vlc_alloc( i_length_in_wchars + 1, sizeof( *psz_name ) );
if( !psz_name )
goto done;
......
......@@ -302,7 +302,7 @@ static int LoadFontsFromAttachments( filter_t *p_filter )
return VLC_EGENERIC;
p_sys->i_font_attachments = 0;
p_sys->pp_font_attachments = malloc( i_attachments_cnt * sizeof(*p_sys->pp_font_attachments));
p_sys->pp_font_attachments = vlc_alloc( i_attachments_cnt, sizeof(*p_sys->pp_font_attachments));
if( !p_sys->pp_font_attachments )
{
for( int i = 0; i < i_attachments_cnt; ++i )
......
......@@ -253,11 +253,11 @@ static paragraph_t *NewParagraph( filter_t *p_filter,
p_paragraph->i_size = i_size;
p_paragraph->p_code_points =
malloc( i_size * sizeof( *p_paragraph->p_code_points ) );
vlc_alloc( i_size, sizeof( *p_paragraph->p_code_points ) );
p_paragraph->pi_glyph_indices =
malloc( i_size * sizeof( *p_paragraph->pi_glyph_indices ) );
vlc_alloc( i_size, sizeof( *p_paragraph->pi_glyph_indices ) );
p_paragraph->pp_styles =
malloc( i_size * sizeof( *p_paragraph->pp_styles ) );
vlc_alloc( i_size, sizeof( *p_paragraph->pp_styles ) );
p_paragraph->pp_faces =
calloc( i_size, sizeof( *p_paragraph->pp_faces ) );
p_paragraph->pi_run_ids =
......@@ -293,16 +293,16 @@ static paragraph_t *NewParagraph( filter_t *p_filter,
}
#ifdef HAVE_HARFBUZZ
p_paragraph->p_scripts = malloc( i_size * sizeof( *p_paragraph->p_scripts ) );
p_paragraph->p_scripts = vlc_alloc( i_size, sizeof( *p_paragraph->p_scripts ) );
if( !p_paragraph->p_scripts )
goto error;
#endif
#ifdef HAVE_FRIBIDI
p_paragraph->p_levels = malloc( i_size * sizeof( *p_paragraph->p_levels ) );
p_paragraph->p_types = malloc( i_size * sizeof( *p_paragraph->p_types ) );
p_paragraph->p_levels = vlc_alloc( i_size, sizeof( *p_paragraph->p_levels ) );
p_paragraph->p_types = vlc_alloc( i_size, sizeof( *p_paragraph->p_types ) );
p_paragraph->pi_reordered_indices =
malloc( i_size * sizeof( *p_paragraph->pi_reordered_indices ) );
vlc_alloc( i_size, sizeof( *p_paragraph->pi_reordered_indices ) );
if( !p_paragraph->p_levels || !p_paragraph->p_types
|| !p_paragraph->pi_reordered_indices )
......@@ -843,7 +843,7 @@ static int ShapeParagraphFriBidi( filter_t *p_filter, paragraph_t *p_paragraph )
}
FriBidiJoiningType *p_joining_types =
malloc( p_paragraph->i_size * sizeof( *p_joining_types ) );
vlc_alloc( p_paragraph->i_size, sizeof( *p_joining_types ) );
if( !p_joining_types )
return VLC_ENOMEM;
......
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