[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
Fri Aug 10 04:05:28 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 ff3fdff..b3d2762 100644
--- a/modules/video_filter/opencv_wrapper.c
+++ b/modules/video_filter/opencv_wrapper.c
@@ -418,6 +418,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;
+    }
 
 #ifndef NDEBUG
     clock_t start = clock();
-- 
1.7.5.4




More information about the vlc-devel mailing list