[vlc-devel] [PATCH] filter: don't create blending filters for fake fmt

Thomas Guillem thomas at gllm.fr
Thu Apr 23 09:06:58 CEST 2015


Since we know the filter configure will fail.
---
 src/misc/filter.c | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

diff --git a/src/misc/filter.c b/src/misc/filter.c
index 36f1ba4..fd2f362 100644
--- a/src/misc/filter.c
+++ b/src/misc/filter.c
@@ -33,7 +33,17 @@
 filter_t *filter_NewBlend( vlc_object_t *p_this,
                            const video_format_t *p_dst_chroma )
 {
-    filter_t *p_blend = vlc_custom_create( p_this, sizeof(*p_blend), "blend" );
+    filter_t *p_blend;
+    const vlc_chroma_description_t *p_desc;
+
+    p_desc = vlc_fourcc_GetChromaDescription( p_dst_chroma->i_chroma );
+    if( !p_desc || p_desc->plane_count == 0 )
+    {
+        msg_Err( p_this, "Could not create blending filter for fake fmt" );
+        return NULL;
+    }
+
+    p_blend = vlc_custom_create( p_this, sizeof(*p_blend), "blend" );
     if( !p_blend )
         return NULL;
 
-- 
2.1.3




More information about the vlc-devel mailing list