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

Commit 4474a768 authored by Ivan Lozano's avatar Ivan Lozano Committed by Android (Google) Code Review
Browse files

Merge "Fix overflow sanitizer in Visualizer_command."

parents 0ee31da6 612d8fcb
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -594,7 +594,9 @@ int Visualizer_command(effect_handle_t self, uint32_t cmdCode, uint32_t cmdSize,
                    deltaSmpl = CAPTURE_BUF_SIZE;
                }

                int32_t capturePoint = (int32_t)pContext->mCaptureIdx - deltaSmpl;
                int32_t capturePoint;
                //capturePoint = (int32_t)pContext->mCaptureIdx - deltaSmpl;
                __builtin_sub_overflow((int32_t)pContext->mCaptureIdx, deltaSmpl, &capturePoint);
                // a negative capturePoint means we wrap the buffer.
                if (capturePoint < 0) {
                    uint32_t size = -capturePoint;