[vlc-devel] [PATCH 4/7] opencv_filter: Don't crash VLC if no picture could be obtained

Edward Wang edward.c.wang at compdigitec.com
Thu Aug 9 21:19:12 CEST 2012


---
 modules/video_filter/opencv_wrapper.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/modules/video_filter/opencv_wrapper.c b/modules/video_filter/opencv_wrapper.c
index 11daeb2..b84f770 100644
--- a/modules/video_filter/opencv_wrapper.c
+++ b/modules/video_filter/opencv_wrapper.c
@@ -413,6 +413,11 @@ static void VlcPictureToIplImage( filter_t* p_filter, picture_t* p_in )
 static picture_t* Filter( filter_t* p_filter, picture_t* p_pic )
 {
     picture_t* p_outpic = filter_NewPicture( p_filter );
+    if( p_outpic == NULL ) {
+        msg_Err( p_filter, "couldn't get a p_outpic!" );
+        picture_Release( p_pic );
+        return NULL;
+    }
 
     clock_t start = clock();
 
-- 
1.7.5.4




More information about the vlc-devel mailing list