diff --git a/src/apps/soundrecorder/ScopeView.cpp b/src/apps/soundrecorder/ScopeView.cpp index 681150068b..fe944b44cf 100644 --- a/src/apps/soundrecorder/ScopeView.cpp +++ b/src/apps/soundrecorder/ScopeView.cpp @@ -120,6 +120,8 @@ void ScopeView::ComputeRendering() { int64 framesCount = fMediaTrack->CountFrames() / SAMPLES_COUNT; + if (framesCount <= 0) + return; T samples[fPlayFormat.u.raw_audio.buffer_size / (fPlayFormat.u.raw_audio.format & media_raw_audio_format::B_AUDIO_SIZE_MASK)]; int64 frames = 0; @@ -160,6 +162,8 @@ ScopeView::ComputeRendering() } } + if (previewMax <= 0) + return; for (int i = 0; i < SAMPLES_COUNT; i++) fPreview[i] = (int32)(fPreview[i] * 1.0 / previewMax * middle + middle); }