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

Commit 79a088a0 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: 14d87911

Change-Id: Icbc43a1d34af774dcf500cdb3548d0399f0b6943
parents 354864c4 14d87911
Loading
Loading
Loading
Loading
+7 −0
Original line number Original line Diff line number Diff line
@@ -563,6 +563,13 @@ status_t AudioFlinger::EffectModule::command(uint32_t cmdCode,
        android_errorWriteLog(0x534e4554, "29251553");
        android_errorWriteLog(0x534e4554, "29251553");
        return -EINVAL;
        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
    if ((cmdCode == EFFECT_CMD_SET_PARAM
            || cmdCode == EFFECT_CMD_SET_PARAM_DEFERRED) &&  // DEFERRED not generally used
            || cmdCode == EFFECT_CMD_SET_PARAM_DEFERRED) &&  // DEFERRED not generally used
        (sizeof(effect_param_t) > cmdSize
        (sizeof(effect_param_t) > cmdSize