From 24179afd283d218971752ee41c0fc7d6312998fb Mon Sep 17 00:00:00 2001 From: "Charles J. Cliffe" Date: Thu, 28 May 2015 18:30:53 -0400 Subject: [PATCH] add ternary to catch possible null pointer bump --- src/visual/ScopeCanvas.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/visual/ScopeCanvas.cpp b/src/visual/ScopeCanvas.cpp index 4a5196a..c80cc54 100644 --- a/src/visual/ScopeCanvas.cpp +++ b/src/visual/ScopeCanvas.cpp @@ -61,7 +61,9 @@ void ScopeCanvas::OnPaint(wxPaintEvent& WXUNUSED(event)) { if (!wxGetApp().getAudioVisualQueue()->empty()) { AudioThreadInput *demodAudioData; wxGetApp().getAudioVisualQueue()->pop(demodAudioData); - int iMax = demodAudioData->data.size(); + + int iMax = demodAudioData?demodAudioData->data.size():0; + if (demodAudioData && iMax) { if (waveform_points.size() != iMax * 2) { waveform_points.resize(iMax * 2);