]> git.sesse.net Git - vlc/commitdiff
* modules/misc/freetype.c, src/video_output/vout_intf.c: fixed a couple of memory...
authorGildas Bazin <gbazin@videolan.org>
Fri, 28 Oct 2005 19:34:27 +0000 (19:34 +0000)
committerGildas Bazin <gbazin@videolan.org>
Fri, 28 Oct 2005 19:34:27 +0000 (19:34 +0000)
modules/misc/freetype.c
src/video_output/vout_intf.c

index f55eb445a767622cdf1ac84245ee127b90cfa32f..98fd7abba941ead2298a8e4e340b79ee2942ed06 100644 (file)
@@ -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++ )
         {
-            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;
             left = 0;
 
@@ -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 );
         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;
 
         /* Do rest */
index f4d5603474308e7f4850827e4d329466a98fdc80..09ff7b7b00b6492b6e941b2690f84aaea854248d 100644 (file)
@@ -265,7 +265,6 @@ void vout_IntfInit( vout_thread_t *p_vout )
             vlc_ureduce( &i_aspect_num, &i_aspect_den,
                          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;
 
         p_vout->i_par_num = i_aspect_num;
@@ -278,6 +277,7 @@ void vout_IntfInit( vout_thread_t *p_vout )
                  p_vout->i_par_num, p_vout->i_par_den );
         b_force_par = VLC_TRUE;
     }
+    if( val.psz_string ) free( val.psz_string );
 
     /* Aspect-ratio object var */
     var_Create( p_vout, "aspect-ratio", VLC_VAR_STRING |