use CELT_MINIMUM_NUM_BYTES to check protocol for network transport message

This commit is contained in:
Volker Fischer 2013-02-12 15:32:43 +00:00
parent 400095b3dc
commit 1c2bbbb009

View file

@ -1299,7 +1299,8 @@ bool CProtocol::EvaluateNetwTranspPropsMes ( const CVector<uint8_t>& vecData )
ReceivedNetwTranspProps.iBaseNetworkPacketSize =
static_cast<uint32_t> ( GetValFromStream ( vecData, iPos, 4 ) );
if ( ( ReceivedNetwTranspProps.iBaseNetworkPacketSize < 1 ) ||
// at least CELT_MINIMUM_NUM_BYTES bytes are required for the CELC codec
if ( ( ReceivedNetwTranspProps.iBaseNetworkPacketSize < CELT_MINIMUM_NUM_BYTES ) ||
( ReceivedNetwTranspProps.iBaseNetworkPacketSize > MAX_SIZE_BYTES_NETW_BUF ) )
{
return true; // return error code