From 7a8a8684d6f8c9956ca7e4f81eb8064b8dece58e Mon Sep 17 00:00:00 2001 From: wangyix Date: Thu, 14 Aug 2014 15:56:13 -0700 Subject: [PATCH] fixed crash when audioscope frame size is reduced --- interface/src/Audio.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/interface/src/Audio.cpp b/interface/src/Audio.cpp index 3009262625..6a22f139b7 100644 --- a/interface/src/Audio.cpp +++ b/interface/src/Audio.cpp @@ -1236,8 +1236,6 @@ void Audio::selectAudioFilterSmiley() { void Audio::toggleScope() { _scopeEnabled = !_scopeEnabled; if (_scopeEnabled) { - _scopeInputOffset = 0; - _scopeOutputOffset = 0; allocateScope(); } else { freeScope(); @@ -1275,6 +1273,8 @@ void Audio::selectAudioScopeFiftyFrames() { } void Audio::allocateScope() { + _scopeInputOffset = 0; + _scopeOutputOffset = 0; int num = _samplesPerScope * sizeof(int16_t); _scopeInput = new QByteArray(num, 0); _scopeOutputLeft = new QByteArray(num, 0);