vfilter: erase: use video_format_Init/Clean
authorFrancois Cartegnie <fcvlcdev@free.fr>
Mon, 21 Nov 2016 19:22:42 +0000 (20:22 +0100)
committerFrancois Cartegnie <fcvlcdev@free.fr>
Mon, 21 Nov 2016 20:22:41 +0000 (21:22 +0100)
modules/video_filter/erase.c

index d5bb723..8f6edfe 100644 (file)
@@ -101,14 +101,15 @@ static void LoadMask( filter_t *p_filter, const char *psz_filename )
     image_handler_t *p_image;
     video_format_t fmt_in, fmt_out;
     picture_t *p_old_mask = p_filter->p_sys->p_mask;
-    memset( &fmt_in, 0, sizeof( video_format_t ) );
-    memset( &fmt_out, 0, sizeof( video_format_t ) );
-    fmt_out.i_chroma = VLC_CODEC_YUVA;
+    video_format_Init( &fmt_in, 0 );
+    video_format_Init( &fmt_out, VLC_CODEC_YUVA );
     p_image = image_HandlerCreate( p_filter );
     char *psz_url = vlc_path2uri( psz_filename, NULL );
     p_filter->p_sys->p_mask =
         image_ReadUrl( p_image, psz_url, &fmt_in, &fmt_out );
     free( psz_url );
+    video_format_Clean( &fmt_in );
+    video_format_Clean( &fmt_out );
     if( p_filter->p_sys->p_mask )
     {
         if( p_old_mask )