title: Callback parameters gets shifted
body: <p>I have a video c++ callback function where the parameters get suddently shifted after a few hours. In debug, it will assert on this:</p>
  
  <pre><code>void CCameraInstance::VideoCallback(void *pContext, unsigned char *pBuffer, long nWidth, long nHeight, long nFrameErrorNo)
  {
     assert(nWidth &lt; 4000);
     CCameraInstance *pThis = (CCameraInstance*)pContext;
     pThis-&gt;PaintFrame(pBuffer, nWidth, nHeight, nFrameErrorNo);
  }
  </code></pre>
  
  <p>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).</p>
  
  <p>How can the parameters get shift that way?</p>