vfilter: alphamask: use video_format_Init/Clean
[vlc.git] / modules / video_filter / alphamask.c
index c57cf34..7e61f79 100644 (file)
@@ -176,9 +176,8 @@ static void LoadMask( filter_t *p_filter, const char *psz_filename )
 {
     image_handler_t *p_image;
     video_format_t fmt_in, fmt_out;
-    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 );
     if( p_filter->p_sys->p_mask )
         picture_Release( p_filter->p_sys->p_mask );
     p_image = image_HandlerCreate( p_filter );
@@ -186,6 +185,8 @@ static void LoadMask( filter_t *p_filter, const char *psz_filename )
     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 );
     image_HandlerDelete( p_image );
 }