[vlc-devel] [PATCH 32/48] puzzle: reject 0 bpp formats

Rémi Denis-Courmont remi at remlab.net
Tue Jul 2 19:51:58 CEST 2013


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

diff --git a/modules/video_filter/puzzle.c b/modules/video_filter/puzzle.c
index 5a34d92..ea8265f 100644
--- a/modules/video_filter/puzzle.c
+++ b/modules/video_filter/puzzle.c
@@ -134,6 +134,11 @@ int Open( 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->pixel_size == 0 )
+        return VLC_EGENERIC;
+
     /* Allocate structure */
     p_filter->p_sys = p_sys = calloc(1, sizeof( *p_sys ) );
     if( !p_sys )
-- 
1.8.3.2




More information about the vlc-devel mailing list