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

Commit 874ee19d authored by android-build-team Robot's avatar android-build-team Robot
Browse files

release-request-0ddf2eab-ecaa-4014-951f-9236b1e43859-for-git_oc-release-407559...

release-request-0ddf2eab-ecaa-4014-951f-9236b1e43859-for-git_oc-release-4075595 snap-temp-L43000000071370789

Change-Id: Ic31274626d6f2ebf347a114e7231c72f5de90e36
parents 871e20e7 d3448da0
Loading
Loading
Loading
Loading
+27 −0
Original line number Diff line number Diff line
@@ -334,6 +334,13 @@ int equalizer_get_parameter(effect_context_t *context, effect_param_t *p,
                }
                break;
        }

        if (p->vsize < 1) {
            p->status = -EINVAL;
            android_errorWriteLog(0x534e4554, "37536407");
            break;
        }

        name = (char *)value;
        strlcpy(name, equalizer_get_preset_name(eq_ctxt, param2), p->vsize - 1);
        name[p->vsize - 1] = 0;
@@ -364,6 +371,7 @@ int equalizer_set_parameter(effect_context_t *context, effect_param_t *p,
    equalizer_context_t *eq_ctxt = (equalizer_context_t *)context;
    int voffset = ((p->psize - 1) / sizeof(int32_t) + 1) * sizeof(int32_t);
    void *value = p->data + voffset;
    int32_t vsize = (int32_t) p->vsize;
    int32_t *param_tmp = (int32_t *)p->data;
    int32_t param = *param_tmp++;
    int32_t preset;
@@ -378,6 +386,10 @@ int equalizer_set_parameter(effect_context_t *context, effect_param_t *p,
    switch (param) {
    case EQ_PARAM_CUR_PRESET:
	ALOGV("EQ_PARAM_CUR_PRESET");
        if (vsize < sizeof(int16_t)) {
           p->status = -EINVAL;
           break;
        }
        preset = (int32_t)(*(uint16_t *)value);

        if ((preset >= equalizer_get_num_presets(eq_ctxt)) || (preset < 0)) {
@@ -388,6 +400,10 @@ int equalizer_set_parameter(effect_context_t *context, effect_param_t *p,
        break;
    case EQ_PARAM_BAND_LEVEL:
	ALOGV("EQ_PARAM_BAND_LEVEL");
        if (vsize < sizeof(int16_t)) {
            p->status = -EINVAL;
            break;
        }
        band =  *param_tmp;
        level = (int32_t)(*(int16_t *)value);
        if (band < 0 || band >= NUM_EQ_BANDS) {
@@ -402,6 +418,10 @@ int equalizer_set_parameter(effect_context_t *context, effect_param_t *p,
        break;
    case EQ_PARAM_PROPERTIES: {
	ALOGV("EQ_PARAM_PROPERTIES");
        if (vsize < sizeof(int16_t)) {
            p->status = -EINVAL;
            break;
        }
        int16_t *prop = (int16_t *)value;
        if ((int)prop[0] >= equalizer_get_num_presets(eq_ctxt)) {
            p->status = -EINVAL;
@@ -410,6 +430,13 @@ int equalizer_set_parameter(effect_context_t *context, effect_param_t *p,
        if (prop[0] >= 0) {
            equalizer_set_preset(eq_ctxt, (int)prop[0]);
        } else {
            if (vsize < (2 + NUM_EQ_BANDS) * sizeof(int16_t)) {
                android_errorWriteLog(0x534e4554, "37563371");
                ALOGE("\tERROR EQ_PARAM_PROPERTIES valueSize %d < %d",
                                  vsize, (2 + NUM_EQ_BANDS) * sizeof(int16_t));
                p->status = -EINVAL;
                break;
            }
            if ((int)prop[1] != NUM_EQ_BANDS) {
                p->status = -EINVAL;
                break;