I have a video c++ callback function where the parameters get suddently shifted after a few hours. In debug, it will assert on this:
void CCameraInstance::VideoCallback(void *pContext, unsigned char *pBuffer, long nWidth, long nHeight, long nFrameErrorNo)
{
assert(nWidth < 4000);
CCameraInstance *pThis = (CCameraInstance*)pContext;
pThis->PaintFrame(pBuffer, nWidth, nHeight, nFrameErrorNo);
}
When the debugger breaks on the assert, nWidth has a big invalid value. However, nHeight is 320 (the width value) and nFrameErrorNo is 240 (the nHeight value).
How can the parameters get shift that way?