Commit 7e748b09 authored by Antoine Cellerier's avatar Antoine Cellerier

Validate input chroma in gradient filter (the current code only supports

planar YUV).
parent 81c68015
/***************************************************************************** /*****************************************************************************
* gradient.c : Gradient and edge detection video effects plugin for vlc * gradient.c : Gradient and edge detection video effects plugin for vlc
***************************************************************************** *****************************************************************************
* Copyright (C) 2000-2006 the VideoLAN team * Copyright (C) 2000-2008 the VideoLAN team
* $Id$ * $Id$
* *
* Authors: Samuel Hocevar <sam@zoy.org> * Authors: Samuel Hocevar <sam@zoy.org>
...@@ -38,6 +38,7 @@ ...@@ -38,6 +38,7 @@
#include <vlc_vout.h> #include <vlc_vout.h>
#include "vlc_filter.h" #include "vlc_filter.h"
#include "filter_picture.h"
enum { GRADIENT, EDGE, HOUGH }; enum { GRADIENT, EDGE, HOUGH };
...@@ -131,6 +132,17 @@ static int Create( vlc_object_t *p_this ) ...@@ -131,6 +132,17 @@ static int Create( vlc_object_t *p_this )
filter_t *p_filter = (filter_t *)p_this; filter_t *p_filter = (filter_t *)p_this;
char *psz_method; char *psz_method;
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 */ /* Allocate structure */
p_filter->p_sys = malloc( sizeof( filter_sys_t ) ); p_filter->p_sys = malloc( sizeof( filter_sys_t ) );
if( p_filter->p_sys == NULL ) if( p_filter->p_sys == NULL )
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment