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

Commit 62498143 authored by rago's avatar rago Committed by android-build-merger
Browse files

Fix potential overflow in Visualizer effect am: 57ac6634 am: 63a99516

am: 38dcbab6

Change-Id: Ic3eb9a21798bbf80c31aa1c6da534f11978685a5
parents 540acb3d 38dcbab6
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -841,6 +841,14 @@ int visualizer_command(effect_context_t * context, uint32_t cmdCode, uint32_t cm
        break;

    case VISUALIZER_CMD_MEASURE: {
        if (pReplyData == NULL || replySize == NULL ||
                *replySize < (sizeof(int32_t) * MEASUREMENT_COUNT)) {
            ALOGV("%s VISUALIZER_CMD_MEASURE error *replySize %d <"
                    "(sizeof(int32_t) * MEASUREMENT_COUNT) %d",
                    __func__, *replySize, sizeof(int32_t) * MEASUREMENT_COUNT);
            android_errorWriteLog(0x534e4554, "30229821");
            return -EINVAL;
        }
        uint16_t peak_u16 = 0;
        float sum_rms_squared = 0.0f;
        uint8_t nb_valid_meas = 0;