added error check to avoid errors in case the network buffer memory is insufficient
This commit is contained in:
parent
24ce20479e
commit
5995e26390
1 changed files with 14 additions and 0 deletions
|
@ -92,6 +92,13 @@ fflush(pFileBI);
|
||||||
bFadeInNewPutData = true;
|
bFadeInNewPutData = true;
|
||||||
|
|
||||||
bPutOK = false; // return error flag
|
bPutOK = false; // return error flag
|
||||||
|
|
||||||
|
// check for special case: buffer memory is not sufficient
|
||||||
|
if ( iInSize > iMemSize )
|
||||||
|
{
|
||||||
|
// do nothing here, just return error code
|
||||||
|
return bPutOK;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// fade in new block if required
|
// fade in new block if required
|
||||||
|
@ -162,6 +169,13 @@ bool CNetBuf::Get ( CVector<double>& vecdData )
|
||||||
bFadeOutExtrap = true;
|
bFadeOutExtrap = true;
|
||||||
|
|
||||||
bGetOK = false; // return error flag
|
bGetOK = false; // return error flag
|
||||||
|
|
||||||
|
// check for special case: buffer memory is not sufficient
|
||||||
|
if ( iInSize > iMemSize )
|
||||||
|
{
|
||||||
|
// do nothing here, just return error code
|
||||||
|
return bGetOK;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// copy data from internal buffer in output buffer
|
// copy data from internal buffer in output buffer
|
||||||
|
|
Loading…
Add table
Reference in a new issue