Hi friends,
I am fetching a problem in which debug exe is runs properly and in release it crashed. I debug the exe in release mode and got the following things.
First I show you code:
void CPlaybackThread::_GetGraphicSurface(uint64_t in_ui64Time,
TAPIMvSurface & out_rjSurface, int iLogoIndex)
{
HRESULT hr = MV_E_FAIL;
unsigned long ulCount = 1;
double dStreamTime = 0;
uint64_t ui64PlayStreamTime = 0;
uint64_t ui64MgfFrameCount = 0;
TAPIMvFlexReader pJMgfPlayListReader = NULL;
TAPIMvPlayList pJMGFPlayList = NULL;
TAPIMvSurface pJLastReadMgfFrame = NULL;
TAPIMvAVContent pJLastReadMgfFrameSynch = NULL;
TAPIMvSurface pJReadMgfFrame = NULL;
SMvSurfaceDescription sGraphicDesc = {sizeof(SMvSurfaceDescription)};
CPlaybackContext &playbackContext = m_pPlaybackDlg->GetPlaybackContext (m_ulCurrentReaderIndex);
ui64PlayStreamTime = playbackContext.GetPlayStreamTime();
pJMGFPlayList = playbackContext.GetMGFPlaylist(iLogoIndex);
pJMgfPlayListReader = playbackContext.GetMGFReader(iLogoIndex);
ui64MgfFrameCount = pJMGFPlayList->GetDuration();
if (ui64PlayStreamTime < ui64MgfFrameCount)
{
hr = pJMgfPlayListReader -> GetBuffer (&pJReadMgfFrame, &ulCount, NULL, NULL, NULL, NULL, NULL, &dStreamTime, in_ui64Time, true);
ASSERT(SUCCEEDED(hr));
}
if (SUCCEEDED(hr))
{
if (pJLastReadMgfFrame != NULL)
{
hr = pJLastReadMgfFrameSynch->SignalReadCompletion();
ASSERT(SUCCEEDED(hr));
pJLastReadMgfFrame = NULL;
pJLastReadMgfFrameSynch = NULL;
}
if (ulCount == 1 || ulCount == 2)
{
out_rjSurface = pJReadMgfFrame;
if (pJLastReadMgfFrame != NULL)
{
hr = pJLastReadMgfFrameSynch->SignalReadCompletion();
ASSERT(SUCCEEDED(hr));
pJLastReadMgfFrame = NULL;
pJLastReadMgfFrameSynch = NULL;
}
hr = out_rjSurface->GetSurfaceDescription(&sGraphicDesc);
ASSERT(SUCCEEDED(hr));
hr = out_rjSurface->ChangeDestinationPosition(&sPosition[iLogoIndex]);
ASSERT(SUCCEEDED(hr));
return;
}
}
}
In the above code the variable 'pJLastReadMgfFrame' is initially null, but while debugging in release without initializing this variable with any other value I got this value as not null.
From where it gets the value i am not getting. And in condition 'if (pJLastReadMgfFrame != NULL)' it enters and crashed on statement 'hr = pJLastReadMgfFrameSynch -> SignalReadCompletion ();'
Can any body help me to resolve this problem.