Code/Desktop
ATL::CImage GetBits memcpy error 해결
codens
2014. 2. 23. 16:58
ATL::CImage GetBits memcpy error 해결
Unhandled exception at xx , 0xC0000005: Access violation writing location
// Get the bitmap image from the stream
if ((hr = cImage.Load(iStream)) == S_OK)
{
// Copy the dib data to the provided buffer
int pitch = cImage.GetPitch();
int height = cImage.GetHeight();
BYTE* pBits = (BYTE*)cImage.GetBits();
if (pitch < 0)
pBits += (pitch *(height -1));
memcpy(captureImage->imageData, pBits, abs(pitch) * height);
}
//
http://code.google.com/p/open-light/source/browse/trunk/cvStructuredLight/cvCanonCamera.cpp?r=3
반응형