From a419ecfde56d87c9b935059b056cbbb6cd04b0ce Mon Sep 17 00:00:00 2001 From: Stefano Fabri Date: Thu, 24 Jun 2010 15:23:43 +0000 Subject: [PATCH] Return false if cannot adapt packed size with mtu max of network adapter --- modules/highgui/src/cap_pvapi.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/modules/highgui/src/cap_pvapi.cpp b/modules/highgui/src/cap_pvapi.cpp index c6b9e3ba3..4ebb9fca2 100644 --- a/modules/highgui/src/cap_pvapi.cpp +++ b/modules/highgui/src/cap_pvapi.cpp @@ -186,7 +186,8 @@ bool CvCaptureCAM_PvAPI::open( int index ) //PvAttrEnumGet(Camera.Handle, "pixelFormat", pixelFormat,256,NULL); maxSize = 8228; PvAttrUint32Get(Camera.Handle,"PacketSize",&maxSize); - PvCaptureAdjustPacketSize(Camera.Handle,maxSize); + if (PvCaptureAdjustPacketSize(Camera.Handle,maxSize)!=ePvErrSuccess) + return false; //printf ("Pixel Format %s %d %d\n ", pixelFormat,frameWidth,frameHeight); if (strncmp(pixelFormat, "Mono8",NULL)==0) { grayframe = cvCreateImage(cvSize((int)frameWidth, (int)frameHeight), IPL_DEPTH_8U, 1);