Commit 92d71fdf authored by Gildas Bazin's avatar Gildas Bazin

* modules/misc/freetype.c, src/video_output/vout_intf.c: fixed a couple of memory leaks.

parent 6b24b403
...@@ -420,7 +420,7 @@ static int Render( filter_t *p_filter, subpicture_region_t *p_region, ...@@ -420,7 +420,7 @@ static int Render( filter_t *p_filter, subpicture_region_t *p_region,
for( y = 1; y < (int)fmt.i_height - 1; y++ ) for( y = 1; y < (int)fmt.i_height - 1; y++ )
{ {
memcpy( p_top, p_dst, fmt.i_width ); if( y > 1 ) memcpy( p_top, p_dst, fmt.i_width );
p_dst += p_region->picture.Y_PITCH; p_dst += p_region->picture.Y_PITCH;
left = 0; left = 0;
...@@ -615,7 +615,11 @@ static int RenderText( filter_t *p_filter, subpicture_region_t *p_region_out, ...@@ -615,7 +615,11 @@ static int RenderText( filter_t *p_filter, subpicture_region_t *p_region_out,
} }
FT_Glyph_Get_CBox( tmp_glyph, ft_glyph_bbox_pixels, &glyph_size ); FT_Glyph_Get_CBox( tmp_glyph, ft_glyph_bbox_pixels, &glyph_size );
i_error = FT_Glyph_To_Bitmap( &tmp_glyph, ft_render_mode_normal, 0, 1); i_error = FT_Glyph_To_Bitmap( &tmp_glyph, ft_render_mode_normal, 0, 1);
if( i_error ) continue; if( i_error )
{
FT_Done_Glyph( tmp_glyph );
continue;
}
p_line->pp_glyphs[ i ] = (FT_BitmapGlyph)tmp_glyph; p_line->pp_glyphs[ i ] = (FT_BitmapGlyph)tmp_glyph;
/* Do rest */ /* Do rest */
......
...@@ -265,7 +265,6 @@ void vout_IntfInit( vout_thread_t *p_vout ) ...@@ -265,7 +265,6 @@ void vout_IntfInit( vout_thread_t *p_vout )
vlc_ureduce( &i_aspect_num, &i_aspect_den, vlc_ureduce( &i_aspect_num, &i_aspect_den,
i_aspect *VOUT_ASPECT_FACTOR, VOUT_ASPECT_FACTOR, 0 ); i_aspect *VOUT_ASPECT_FACTOR, VOUT_ASPECT_FACTOR, 0 );
} }
free( val.psz_string );
if( !i_aspect_num || !i_aspect_den ) i_aspect_num = i_aspect_den = 1; if( !i_aspect_num || !i_aspect_den ) i_aspect_num = i_aspect_den = 1;
p_vout->i_par_num = i_aspect_num; p_vout->i_par_num = i_aspect_num;
...@@ -278,6 +277,7 @@ void vout_IntfInit( vout_thread_t *p_vout ) ...@@ -278,6 +277,7 @@ void vout_IntfInit( vout_thread_t *p_vout )
p_vout->i_par_num, p_vout->i_par_den ); p_vout->i_par_num, p_vout->i_par_den );
b_force_par = VLC_TRUE; b_force_par = VLC_TRUE;
} }
if( val.psz_string ) free( val.psz_string );
/* Aspect-ratio object var */ /* Aspect-ratio object var */
var_Create( p_vout, "aspect-ratio", VLC_VAR_STRING | var_Create( p_vout, "aspect-ratio", VLC_VAR_STRING |
......
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