Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 4b7780ab authored by Andy Hung's avatar Andy Hung Committed by android-build-merger
Browse files

Effects: Check get parameter command size am: 3d34cc76 am: 59920bf7 am:...

Effects: Check get parameter command size am: 3d34cc76 am: 59920bf7 am: 14d87911 am: 79a088a0 am: 58e5681c am: f0f864a1 am: 134e2084 am: 5662efe7 am: 1ad93b96 am: 8c8eb964 am: 34f29aac am: dfb1bd97
am: 791d3938

Change-Id: I90c06c4df7b22730aa78ffedd137b414fe20c448
parents a0be5d86 791d3938
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -600,6 +600,13 @@ status_t AudioFlinger::EffectModule::command(uint32_t cmdCode,
        android_errorWriteLog(0x534e4554, "29251553");
        return -EINVAL;
    }
    if (cmdCode == EFFECT_CMD_GET_PARAM &&
            (sizeof(effect_param_t) > cmdSize ||
                    ((effect_param_t *)pCmdData)->psize > cmdSize
                                                          - sizeof(effect_param_t))) {
        android_errorWriteLog(0x534e4554, "32438594");
        return -EINVAL;
    }
    if ((cmdCode == EFFECT_CMD_SET_PARAM
            || cmdCode == EFFECT_CMD_SET_PARAM_DEFERRED) &&  // DEFERRED not generally used
        (sizeof(effect_param_t) > cmdSize