Check frame length bounds and samplerate
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
DataHoarder 2022-04-22 19:55:14 +02:00
parent 8294d09f7f
commit 03a8d373b7
Signed by: DataHoarder
SSH key fingerprint: SHA256:OLTRf6Fl87G52SiR7sWLGNzlJt4WOX+tfI2yxo0z7xk

View file

@ -130,7 +130,8 @@ int32_t ALACDecoder::Init( void * inMagicCookie, uint32_t inMagicCookieSize )
mConfig = theConfig;
RequireAction( mConfig.compatibleVersion <= kALACVersion, return kALAC_ParamError; );
RequireAction( mConfig.frameLength > 0, return kALAC_ParamError; );
RequireAction( mConfig.frameLength > 0 && mConfig.frameLength <= 16384, return kALAC_ParamError; );
RequireAction( mConfig.sampleRate > 0 && mConfig.sampleRate <= 384000, return kALAC_ParamError; );
// allocate mix buffers
mMixBufferU = (int32_t *) calloc( mConfig.frameLength * sizeof(int32_t), 1 );