Bug #3044 cap_dshow.cpp forgotten validity check fixed.
authorAlexander Smorkalov <alexander.smorkalov@itseez.com>
Mon, 10 Jun 2013 20:29:45 +0000 (13:29 -0700)
committerAlexander Smorkalov <alexander.smorkalov@itseez.com>
Mon, 10 Jun 2013 20:29:45 +0000 (13:29 -0700)
modules/highgui/src/cap_dshow.cpp

index 21fb947..b7cfbd9 100644 (file)
@@ -3195,8 +3195,10 @@ IplImage* CvCaptureCAM_DShow::retrieveFrame(int)
         frame = cvCreateImage( cvSize(w,h), 8, 3 );
     }
 
-    VI.getPixels( index, (uchar*)frame->imageData, false, true );
-    return frame;
+    if (VI.getPixels( index, (uchar*)frame->imageData, false, true ))
+        return frame;
+    else
+        return NULL;
 }
 
 double CvCaptureCAM_DShow::getProperty( int property_id )