Add EFFECT_CMD_SET_PARAM parameter checking

Bug: 30204301
Change-Id: Ib9c3ee1c2f23c96f8f7092dd9e146bc453d7a290
(cherry picked from commit e4a1d91501d47931dbae19c47815952378787ab6)

AudioFlinger::EffectModule::EffectModule(ThreadBase *thread,
 const wp<AudioFlinger::EffectChain>& chain,
 effect_descriptor_t *desc,
 int id,
 audio_session_t sessionId)
 : mPinned(sessionId > AUDIO_SESSION_OUTPUT_MIX),
      mThread(thread), mChain(chain), mId(id), mSessionId(sessionId),
      mDescriptor(*desc),
      mEffectInterface(NULL),
      mStatus(NO_INIT), mState(IDLE),
      mSuspended(false),
      mAudioFlinger(thread->mAudioFlinger)
{
    ALOGV("Constructor %p", this);
 int lStatus;

    mStatus = EffectCreate(&desc->uuid, sessionId, thread->id(), &mEffectInterface);

 if (mStatus != NO_ERROR) {
 return;
 }
    lStatus = init();
 if (lStatus < 0) {
        mStatus = lStatus;
 goto Error;
 }

    ALOGV("Constructor success name %s, Interface %p", mDescriptor.name, mEffectInterface);
 return;
Error:
 EffectRelease(mEffectInterface);
    mEffectInterface = NULL;
    ALOGV("Constructor Error %d", mStatus);
}

AudioFlinger::EffectModule::EffectModule(ThreadBase *thread,
 const wp<AudioFlinger::EffectChain>& chain,
 effect_descriptor_t *desc,
 int id,
 audio_session_t sessionId)
 : mPinned(sessionId > AUDIO_SESSION_OUTPUT_MIX),
      mThread(thread), mChain(chain), mId(id), mSessionId(sessionId),
      mDescriptor(*desc),
      mEffectInterface(NULL),
      mStatus(NO_INIT), mState(IDLE),
      mSuspended(false),
      mAudioFlinger(thread->mAudioFlinger)
{
    ALOGV("Constructor %p", this);
 int lStatus;

    mStatus = EffectCreate(&desc->uuid, sessionId, thread->id(), &mEffectInterface);

 if (mStatus != NO_ERROR) {
 return;
 }
    lStatus = init();
 if (lStatus < 0) {
        mStatus = lStatus;
 goto Error;
 }

    ALOGV("Constructor success name %s, Interface %p", mDescriptor.name, mEffectInterface);
 return;
Error:
 EffectRelease(mEffectInterface);
    mEffectInterface = NULL;
    ALOGV("Constructor Error %d", mStatus);
}
