]> git.sesse.net Git - vlc/commitdiff
wave: reject 0 planes formats
authorRémi Denis-Courmont <remi@remlab.net>
Sun, 23 Jun 2013 06:13:26 +0000 (09:13 +0300)
committerRémi Denis-Courmont <remi@remlab.net>
Sun, 7 Jul 2013 18:12:01 +0000 (21:12 +0300)
modules/video_filter/wave.c

index c2c93bd54f763bea23f41d907a96a07f7508eb56..3fbfcab6651e27e69ad5c9277a941d41ae49a3dd 100644 (file)
@@ -81,6 +81,11 @@ static int Create( vlc_object_t *p_this )
 {
     filter_t *p_filter = (filter_t *)p_this;
 
 {
     filter_t *p_filter = (filter_t *)p_this;
 
+    const vlc_chroma_description_t *p_chroma =
+        vlc_fourcc_GetChromaDescription( p_filter->fmt_in.video.i_chroma );
+    if( p_chroma == NULL || p_chroma->plane_count == 0 )
+        return VLC_EGENERIC;
+
     /* Allocate structure */
     p_filter->p_sys = malloc( sizeof( filter_sys_t ) );
     if( p_filter->p_sys == NULL )
     /* Allocate structure */
     p_filter->p_sys = malloc( sizeof( filter_sys_t ) );
     if( p_filter->p_sys == NULL )