diff options
author | Jan Holthuis <jholthuis@mixxx.org> | 2021-07-03 23:24:29 +0200 |
---|---|---|
committer | Jan Holthuis <jholthuis@mixxx.org> | 2021-07-03 23:24:29 +0200 |
commit | 86dd12fe43e61111e2e85a745682de243cfd44d5 (patch) | |
tree | 1e17bf57b3d36480f6b4597c14ac30c0682af8b5 /src/audio | |
parent | 3ac8866e0b9e88fd7a2c01cb3b1bdb4e55ca25e2 (diff) |
FramePos: Add assertions to prevent calculations with invalid values
Diffstat (limited to 'src/audio')
-rw-r--r-- | src/audio/frame.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/audio/frame.h b/src/audio/frame.h index a22ba84a7f..068399d09a 100644 --- a/src/audio/frame.h +++ b/src/audio/frame.h @@ -73,21 +73,25 @@ class FramePos final { } FramePos& operator+=(FrameDiff_t increment) { + DEBUG_ASSERT(isValid()); m_framePosition += increment; return *this; } FramePos& operator-=(FrameDiff_t decrement) { + DEBUG_ASSERT(isValid()); m_framePosition -= decrement; return *this; } FramePos& operator*=(double multiple) { + DEBUG_ASSERT(isValid()); m_framePosition *= multiple; return *this; } FramePos& operator/=(double divisor) { + DEBUG_ASSERT(isValid()); m_framePosition /= divisor; return *this; } |