]> git.sesse.net Git - vlc/commitdiff
Validate input chroma for grain filter (planar yuv).
authorAntoine Cellerier <dionoea@videolan.org>
Sat, 31 May 2008 15:07:58 +0000 (17:07 +0200)
committerAntoine Cellerier <dionoea@videolan.org>
Sat, 31 May 2008 15:19:41 +0000 (17:19 +0200)
modules/video_filter/grain.c

index 041e87378fc1c03d2f777cd18dc0dc57d281bab1..ad01a25eff75625e91a517e0b32cefac71635ba1 100644 (file)
@@ -34,6 +34,7 @@
 #include <vlc_vout.h>
 
 #include "vlc_filter.h"
+#include "filter_picture.h"
 
 /*****************************************************************************
  * Local prototypes
@@ -67,7 +68,16 @@ static int Create( vlc_object_t *p_this )
 {
     filter_t *p_filter = (filter_t *)p_this;
 
-    /* FIXME: check that chroma is YUV based */
+    switch( p_filter->fmt_in.video.i_chroma )
+    {
+        CASE_PLANAR_YUV
+            break;
+
+        default:
+            msg_Err( p_filter, "Unsupported input chroma (%4s)",
+                     (char*)&(p_filter->fmt_in.video.i_chroma) );
+            return VLC_EGENERIC;
+    }
 
     /* Allocate structure */
     p_filter->p_sys = malloc( sizeof( filter_sys_t ) );