From 107b1c9ae60ca502a27a13ec7491c64a39937580 Mon Sep 17 00:00:00 2001 From: f4exb Date: Sun, 11 Mar 2018 00:16:39 +0100 Subject: [PATCH] DATV demod: prevent segfault when DATV constellation screen is not registered --- plugins/channelrx/demoddatv/datvdemod.cpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/plugins/channelrx/demoddatv/datvdemod.cpp b/plugins/channelrx/demoddatv/datvdemod.cpp index fb52bb273..bf04aa6e6 100644 --- a/plugins/channelrx/demoddatv/datvdemod.cpp +++ b/plugins/channelrx/demoddatv/datvdemod.cpp @@ -694,11 +694,14 @@ void DATVDemod::InitDATVFramework() //constellation - m_objRegisteredDATVScreen->resizeDATVScreen(256,256); + if (m_objRegisteredDATVScreen) + { + m_objRegisteredDATVScreen->resizeDATVScreen(256,256); - r_scope_symbols = new leansdr::datvconstellation(m_objScheduler, *p_sampled, -128,128, NULL, m_objRegisteredDATVScreen); - r_scope_symbols->decimation = 1; - r_scope_symbols->cstln = &m_objDemodulator->cstln; + r_scope_symbols = new leansdr::datvconstellation(m_objScheduler, *p_sampled, -128,128, NULL, m_objRegisteredDATVScreen); + r_scope_symbols->decimation = 1; + r_scope_symbols->cstln = &m_objDemodulator->cstln; + } // DECONVOLUTION AND SYNCHRONIZATION