Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions src/buffer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,8 @@ bool CNetBuf::Put ( const CVector<uint8_t>& vecbyData, int iInSize )
const int iNumBlocks = /* floor */ ( iInSize / iBlockSize );

// copy new data in internal buffer
for ( int iBlock = 0; iBlock < iNumBlocks; iBlock++ )
// iBlock is a long to avoid overflowing a mulitplication later in the code
for ( long iBlock = 0; iBlock < iNumBlocks; iBlock++ )
Comment thread
softins marked this conversation as resolved.
{
// extract sequence number of current received block (per definition
// the sequence number is appended after the coded audio data)
Expand Down Expand Up @@ -263,7 +264,8 @@ bool CNetBuf::Put ( const CVector<uint8_t>& vecbyData, int iInSize )
// copy new data in internal buffer
const int iNumBlocks = iInSize / iBlockSize;

for ( int iBlock = 0; iBlock < iNumBlocks; iBlock++ )
// iBlock is a long to avoid overflowing a mulitplication later in the code
for ( long iBlock = 0; iBlock < iNumBlocks; iBlock++ )
Comment thread
softins marked this conversation as resolved.
{
// for simultion buffer only update pointer, no data copying
if ( !bIsSimulation )
Expand Down