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

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

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

Fix potential overflow in Visualizer effect am: 57ac6634 am: 63a99516 am: 38dcbab6 am: 62498143 am: 94cc18ee am: 3f11c1f1 am: 6a3492d5 am: d18f6149 am: 3a3a4f81 am: 27ff940a
am: f3497bec

Change-Id: I47b3f8189b794ffa393a7d5a964bc551dd405e0e
parents 2db61564 f3497bec
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -867,6 +867,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;