[vlc-devel] [PATCH 03/12] vlc: filter_DeleteBlend: do nothing if argument is NULL

Filip Roséen filip at videolabs.io
Mon Mar 14 11:08:54 CET 2016


---
 include/vlc_filter.h | 4 ++++
 src/misc/filter.c    | 3 +++
 2 files changed, 7 insertions(+)

diff --git a/include/vlc_filter.h b/include/vlc_filter.h
index afe0205..fafe12c 100644
--- a/include/vlc_filter.h
+++ b/include/vlc_filter.h
@@ -237,6 +237,10 @@ VLC_API int filter_Blend( filter_t *, picture_t *p_dst, int i_dst_x, int i_dst_y
 
 /**
  * It destroys a blend filter created by filter_NewBlend.
+ *
+ * If the pointer passed to the function is NULL, the function does nothing.
+ *
+ * \param p_blend pointer to the blend filter to destroy.
  */
 VLC_API void filter_DeleteBlend( filter_t * );
 
diff --git a/src/misc/filter.c b/src/misc/filter.c
index 36f1ba4..df0bf4c 100644
--- a/src/misc/filter.c
+++ b/src/misc/filter.c
@@ -105,6 +105,9 @@ int filter_Blend( filter_t *p_blend,
 
 void filter_DeleteBlend( filter_t *p_blend )
 {
+    if( p_blend == NULL )
+        return;
+
     if( p_blend->p_module )
         module_unneed( p_blend, p_blend->p_module );
 
-- 
2.7.3



More information about the vlc-devel mailing list