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

Commit b66492c7 authored by rago's avatar rago
Browse files

Fix potential NULL dereference in Visualizer effect

Bug: 30229821

Test: fixing CL. Existing unit tests still pass.

Change-Id: I6e4abd759d5d2abc3b391e92e2e18f060cab7af0
parent 4e1fe188
Loading
Loading
Loading
Loading
+8 −3
Original line number Diff line number Diff line
@@ -602,9 +602,14 @@ int Visualizer_command(effect_handle_t self, uint32_t cmdCode, uint32_t cmdSize,
    case VISUALIZER_CMD_MEASURE: {
        if (pReplyData == NULL || replySize == NULL ||
                *replySize < (sizeof(int32_t) * MEASUREMENT_COUNT)) {
            if (replySize == NULL) {
                ALOGV("VISUALIZER_CMD_MEASURE() error replySize NULL");
            } else {
                ALOGV("VISUALIZER_CMD_MEASURE() error *replySize %" PRIu32
                    " < (sizeof(int32_t) * MEASUREMENT_COUNT) %" PRIu32, *replySize,
                        " < (sizeof(int32_t) * MEASUREMENT_COUNT) %" PRIu32,
                        *replySize,
                        uint32_t(sizeof(int32_t)) * MEASUREMENT_COUNT);
            }
            android_errorWriteLog(0x534e4554, "30229821");
            return -EINVAL;
        }