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

Commit e65280c5 authored by Eric Laurent's avatar Eric Laurent
Browse files

Fix problem in AudioEffect::command() status.

The *pReplyData argument of the command() function was left unitialized by EffectHandle::command()
when command was EFFECT_CMD_ENABLE, EFFECT_CMD_DISABLE and EFFECT_CMD_SET_PARAM_COMMIT.

Change-Id: I91a19817ead2a8cfbdd8e2d77ca270c7ce9d5bd4
parent 73ef5d4e
Loading
Loading
Loading
Loading
+9 −5
Original line number Diff line number Diff line
@@ -5992,12 +5992,14 @@ status_t AudioFlinger::EffectHandle::command(uint32_t cmdCode,
                                            p,
                                            &rsize,
                                            &reply);
            if (ret == NO_ERROR) {
                if (reply != NO_ERROR) {
                    status = reply;
                }
            } else {
            // stop at first error encountered
            if (ret != NO_ERROR) {
                status = ret;
                *(int *)pReplyData = reply;
                break;
            } else if (reply != NO_ERROR) {
                *(int *)pReplyData = reply;
                break;
            }
            mCblk->serverIndex += size;
        }
@@ -6005,8 +6007,10 @@ status_t AudioFlinger::EffectHandle::command(uint32_t cmdCode,
        mCblk->clientIndex = 0;
        return status;
    } else if (cmdCode == EFFECT_CMD_ENABLE) {
        *(int *)pReplyData = NO_ERROR;
        return enable();
    } else if (cmdCode == EFFECT_CMD_DISABLE) {
        *(int *)pReplyData = NO_ERROR;
        return disable();
    }