]> git.sesse.net Git - vlc/blobdiff - modules/misc/quartztext.c
Lua_ext: fix race condition.
[vlc] / modules / misc / quartztext.c
index 0f332c753f8099885e0090bf9162e22b3f4a0563..732f276f2c1d90a2af50fafd6e513ef089f332e6 100644 (file)
@@ -506,7 +506,7 @@ static int HandleFontAttributes( xml_reader_t *p_xml_reader,
         {
             if( !strcasecmp( "face", psz_name ) )
             {
-                if( psz_fontname ) free( psz_fontname );
+                free( psz_fontname );
                 psz_fontname = strdup( psz_value );
             }
             else if( !strcasecmp( "size", psz_name ) )
@@ -1045,12 +1045,11 @@ static int RenderYUVA( filter_t *p_filter, subpicture_region_t *p_region,
     // Create a new subpicture region
     memset( &fmt, 0, sizeof(video_format_t) );
     fmt.i_chroma = VLC_CODEC_YUVA;
-    fmt.i_aspect = 0;
     fmt.i_width = fmt.i_visible_width = i_width;
     fmt.i_height = fmt.i_visible_height = __MIN( i_height, i_textblock_height + VERTICAL_MARGIN * 2);
     fmt.i_x_offset = fmt.i_y_offset = 0;
 
-    p_region->p_picture = picture_New( fmt.i_chroma, fmt.i_width, fmt.i_height, fmt.i_aspect );
+    p_region->p_picture = picture_NewFromFormat( &fmt );
     if( !p_region->p_picture )
         return VLC_EGENERIC;
     p_region->fmt = fmt;