[vlc-commits] text_renderer: svg: use video_format_Init/Clean

Francois Cartegnie git at videolan.org
Mon Nov 21 21:23:03 CET 2016


vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Mon Nov 21 20:19:05 2016 +0100| [d487e659aa9b2872647269e680f98c091be25f50] | committer: Francois Cartegnie

text_renderer: svg: use video_format_Init/Clean

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=d487e659aa9b2872647269e680f98c091be25f50
---

 modules/text_renderer/svg.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/modules/text_renderer/svg.c b/modules/text_renderer/svg.c
index 15717d4..deb5dd5 100644
--- a/modules/text_renderer/svg.c
+++ b/modules/text_renderer/svg.c
@@ -265,7 +265,7 @@ static int Render( filter_t *p_filter, subpicture_region_t *p_region,
     i_height = gdk_pixbuf_get_height( p_svg->p_rendition );
 
     /* Create a new subpicture region */
-    memset( &fmt, 0, sizeof( video_format_t ) );
+    video_format_Init( &fmt, VLC_CODEC_YUVA );
     fmt.i_chroma = VLC_CODEC_YUVA;
     fmt.i_width = fmt.i_visible_width = i_width;
     fmt.i_height = fmt.i_visible_height = i_height;
@@ -275,7 +275,10 @@ static int Render( filter_t *p_filter, subpicture_region_t *p_region,
 
     p_region->p_picture = picture_NewFromFormat( &fmt );
     if( !p_region->p_picture )
+    {
+        video_format_Clean( &fmt );
         return VLC_EGENERIC;
+    }
     p_region->fmt = fmt;
 
     p_region->i_x = p_region->i_y = 0;



More information about the vlc-commits mailing list