[vlc-commits] cropadd: reject 0 planes formats

Rémi Denis-Courmont git at videolan.org
Sun Jul 7 20:13:40 CEST 2013


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Sun Jun 23 09:12:02 2013 +0300| [e3898bea986b20964315925dbeb3ab62169f1b1f] | committer: Rémi Denis-Courmont

cropadd: reject 0 planes formats

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=e3898bea986b20964315925dbeb3ab62169f1b1f
---

 modules/video_filter/croppadd.c |    5 +++++
 1 file changed, 5 insertions(+)

diff --git a/modules/video_filter/croppadd.c b/modules/video_filter/croppadd.c
index b4f2f2d..8c46ee9 100644
--- a/modules/video_filter/croppadd.c
+++ b/modules/video_filter/croppadd.c
@@ -144,6 +144,11 @@ static int OpenFilter( vlc_object_t *p_this )
         return VLC_EGENERIC;
     }
 
+    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;
+
     p_filter->p_sys = (filter_sys_t *)malloc( sizeof( filter_sys_t ) );
     if( !p_filter->p_sys ) return VLC_ENOMEM;
 



More information about the vlc-commits mailing list