Page 1 of 1

Stack error while running code samples

Posted: Thu Aug 05, 2021 10:39 am
by nirvik
I am trying to use the camera SDK sample Visual Cpp codes with Optitrack prime cameras. While running the simpleCameraTest.cpp project, the cameras are listed as expected but at the end of the main function the debugger pops up the following error:

Code: Select all

Run-Time Check Failure #2 - Stack around the variable 'list' was corrupted.
An extensive googling of this issue did not reveal much insights except that something might be incorrect inside the cameralist class def. 
I would appreciate any help on this issue?

Re: Stack error while running code samples

Posted: Sun Aug 08, 2021 4:50 am
by nirvik
Apparently using a pointer to the cameralist instead somehow removes the error, not sure why though:

Code: Select all

	CameraList* list = new CameraList;
	printf("Available cameras and/or other hardware:\n");
	int cameraCount = list->Count();
	for (int i = 0; i < cameraCount; i++)
	{
		printf("Camera %d : %s\n", i, (*list)[i].Name());
	}
	if (cameraCount == 0)
		printf("None\n");

Re: Stack error while running code samples

Posted: Tue Aug 10, 2021 1:27 am
by serdar
Hi Nirvik,

Which version of camera SDK you are using? I have the same problem. It started when I updated the camera SDK to 2.3.0.