motionblur: reject 0 planes formats
authorRémi Denis-Courmont <remi@remlab.net>
Sun, 23 Jun 2013 06:12:34 +0000 (09:12 +0300)
committerRémi Denis-Courmont <remi@remlab.net>
Sun, 7 Jul 2013 18:12:01 +0000 (21:12 +0300)
modules/video_filter/motionblur.c

index 0e46479..4dedc12 100644 (file)
@@ -91,6 +91,11 @@ static int Create( vlc_object_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 )