From deefab7c7c3a01eee8827d51532e8972347fb017 Mon Sep 17 00:00:00 2001 From: f4exb Date: Fri, 30 Mar 2018 23:41:48 +0200 Subject: [PATCH] ATV demod: fixed segfault when TV screen pointer is not set yet by the GUI --- plugins/channelrx/demodatv/atvdemod.cpp | 12 ++++++------ plugins/channelrx/demodatv/atvdemod.h | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/plugins/channelrx/demodatv/atvdemod.cpp b/plugins/channelrx/demodatv/atvdemod.cpp index 48516cd83..73ac7ef83 100644 --- a/plugins/channelrx/demodatv/atvdemod.cpp +++ b/plugins/channelrx/demodatv/atvdemod.cpp @@ -431,13 +431,13 @@ void ATVDemod::demod(Complex& c) //********** process video sample ********** - if (m_running.m_enmATVStandard == ATVStdHSkip) + if (m_registeredTVScreen) // can process only if the screen is available (set via the GUI) { - processHSkip(fltVal, intVal); - } - else - { - processClassic(fltVal, intVal); + if (m_running.m_enmATVStandard == ATVStdHSkip) { + processHSkip(fltVal, intVal); + } else { + processClassic(fltVal, intVal); + } } } diff --git a/plugins/channelrx/demodatv/atvdemod.h b/plugins/channelrx/demodatv/atvdemod.h index 419c92623..dda259740 100644 --- a/plugins/channelrx/demodatv/atvdemod.h +++ b/plugins/channelrx/demodatv/atvdemod.h @@ -231,7 +231,7 @@ public: virtual QByteArray serialize() const { return QByteArray(); } virtual bool deserialize(const QByteArray& data __attribute__((unused))) { return false; } - void setTVScreen(TVScreen *objScreen); + void setTVScreen(TVScreen *objScreen); //!< set by the GUI int getSampleRate(); int getEffectiveSampleRate(); double getMagSq() const { return m_objMagSqAverage; } //!< Beware this is scaled to 2^30