From 6d0c022347550724811cbacb63603c5fee3a9f33 Mon Sep 17 00:00:00 2001 From: Alexander Reshetnikov Date: Thu, 12 Apr 2012 12:11:43 +0000 Subject: [PATCH] Fixed cameras segfault (patch #1771) --- modules/highgui/src/cap_pvapi.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/modules/highgui/src/cap_pvapi.cpp b/modules/highgui/src/cap_pvapi.cpp index 31518f82f..1020e1739 100644 --- a/modules/highgui/src/cap_pvapi.cpp +++ b/modules/highgui/src/cap_pvapi.cpp @@ -358,6 +358,8 @@ CvCapture* cvCreateCameraCapture_PvAPI( int index ) { CvCaptureCAM_PvAPI* capture = new CvCaptureCAM_PvAPI; + memset(&capture->Camera, 0, sizeof(tCamera)); + if ( capture->open( index )) return capture;