diff --git a/devices/limesdr/devicelimesdr.cpp b/devices/limesdr/devicelimesdr.cpp index a2efec0e4..4eeec1bf9 100644 --- a/devices/limesdr/devicelimesdr.cpp +++ b/devices/limesdr/devicelimesdr.cpp @@ -167,7 +167,7 @@ bool DeviceLimeSDR::SetRFELNA_dB(lms_device_t *device, std::size_t chan, int val { if (LMS_WriteParam(device, LMS7param(MAC), chan+1) < 0) { - fprintf(stderr, "DeviceLimeSDR::SetRFELNA_dB: cannot set channel to #%lu\n", chan); + fprintf(stderr, "DeviceLimeSDR::SetRFELNA_dB: cannot set channel to #%zu\n", chan); return false; } @@ -207,7 +207,7 @@ bool DeviceLimeSDR::SetRFETIA_dB(lms_device_t *device, std::size_t chan, int val { if (LMS_WriteParam(device, LMS7param(MAC), chan+1) < 0) { - fprintf(stderr, "DeviceLimeSDR::SetRFETIA_dB: cannot set channel to #%lu\n", chan); + fprintf(stderr, "DeviceLimeSDR::SetRFETIA_dB: cannot set channel to #%zu\n", chan); return false; } @@ -232,7 +232,7 @@ bool DeviceLimeSDR::SetRBBPGA_dB(lms_device_t *device, std::size_t chan, float v { if (LMS_WriteParam(device, LMS7param(MAC), chan+1) < 0) { - fprintf(stderr, "DeviceLimeSDR::SetRBBPGA_dB: cannot set channel to #%lu\n", chan); + fprintf(stderr, "DeviceLimeSDR::SetRBBPGA_dB: cannot set channel to #%zu\n", chan); return false; } diff --git a/devices/perseus/deviceperseus.h b/devices/perseus/deviceperseus.h index 326449c1f..89221937f 100644 --- a/devices/perseus/deviceperseus.h +++ b/devices/perseus/deviceperseus.h @@ -34,8 +34,8 @@ public: protected: DevicePerseus(); - DevicePerseus(const DevicePerseus&) : m_nbDevices(0) {} - DevicePerseus& operator=(const DevicePerseus& other) { (void) other; return *this; } + DevicePerseus(const DevicePerseus&) = delete; + DevicePerseus& operator=(const DevicePerseus&) = delete; ~DevicePerseus(); private: diff --git a/ft8/libldpc.cpp b/ft8/libldpc.cpp index ad1cb71d8..99179be53 100644 --- a/ft8/libldpc.cpp +++ b/ft8/libldpc.cpp @@ -409,7 +409,7 @@ void LDPC::gauss_jordan(int rows, int cols, int m[174][2 * 91], int which[91], i { if (m[row][row] != 1) { - for (int row1 = row + 1; row1 < cols; row1++) + for (int row1 = row + 1; row1 < rows; row1++) { if (m[row1][row] == 1) { @@ -436,7 +436,7 @@ void LDPC::gauss_jordan(int rows, int cols, int m[174][2 * 91], int which[91], i // lazy creation of identity matrix in the upper-right quarter m[row][rows + row] = (m[row][rows + row] + 1) % 2; // now eliminate - for (int row1 = 0; row1 < cols; row1++) + for (int row1 = 0; row1 < rows; row1++) { if (row1 == row) continue; diff --git a/httpserver/httpresponse.cpp b/httpserver/httpresponse.cpp index 16341f25c..cbc6a21a5 100644 --- a/httpserver/httpresponse.cpp +++ b/httpserver/httpresponse.cpp @@ -130,14 +130,11 @@ void HttpResponse::write(QByteArray data, bool lastPart) { if (chunkedMode) { - if (data.size()>0) - { - QByteArray size=QByteArray::number(data.size(),16); - writeToSocket(size); - writeToSocket("\r\n"); - writeToSocket(data); - writeToSocket("\r\n"); - } + QByteArray size=QByteArray::number(data.size(),16); + writeToSocket(size); + writeToSocket("\r\n"); + writeToSocket(data); + writeToSocket("\r\n"); } else { diff --git a/modemdab/dabensemble.cpp b/modemdab/dabensemble.cpp index e0d0523ee..4e11c8ac9 100644 --- a/modemdab/dabensemble.cpp +++ b/modemdab/dabensemble.cpp @@ -968,6 +968,10 @@ void DABEnsemble::fig2(const uint8_t *data, int length) field.insert(field.end(), label.segments[i].begin(), label.segments[i].end()); } + if (field.size() < 3) { + return; + } + const bool ucs2 = (field[0] & 0x80) != 0; const uint16_t flags = static_cast((field[1] << 8) | field[2]); const int charset = ucs2 ? 6 : 15; diff --git a/modemdab/dabfft.cpp b/modemdab/dabfft.cpp index fe80c3b50..f583bdd4a 100644 --- a/modemdab/dabfft.cpp +++ b/modemdab/dabfft.cpp @@ -85,7 +85,7 @@ void DABFFT::transform(const std::complex *in, std::complex *out) // Through the plan's aligned buffers, so any input and output can be used std::memcpy(m_implementation->in, in, sizeof(fftwf_complex) * m_size); fftwf_execute(m_implementation->plan); - std::memcpy(out, m_implementation->out, sizeof(fftwf_complex) * m_size); + std::memcpy(static_cast(out), m_implementation->out, sizeof(fftwf_complex) * m_size); } const char *DABFFT::backend() diff --git a/modemdab/dabmsc.cpp b/modemdab/dabmsc.cpp index 7d02839e1..aa31a4b06 100644 --- a/modemdab/dabmsc.cpp +++ b/modemdab/dabmsc.cpp @@ -30,8 +30,8 @@ DABSubchannelDecoder::DABSubchannelDecoder() : m_filled(0), m_lastDamaged(false), m_bitErrors(0), - m_countErrors(true), - m_comparedBits(0) + m_comparedBits(0), + m_countErrors(true) { reset(); } diff --git a/modemdab/dabofdm.cpp b/modemdab/dabofdm.cpp index 510107657..1131a4030 100644 --- a/modemdab/dabofdm.cpp +++ b/modemdab/dabofdm.cpp @@ -101,9 +101,9 @@ DABFrontEnd::DABFrontEnd() : m_exportCarriers(false), m_filterFFT(FilterFFTSize, false), m_filterIFFT(FilterFFTSize, true), + m_haveCarrierPower(false), m_haveCarrierNoise(false), - m_noiseFrames(0), - m_haveCarrierPower(false) + m_noiseFrames(0) { // Kaiser windowed sinc (beta 7.86 for about 80 dB of stop band attenuation) std::vector> taps(FilterFFTSize, 0.0f); diff --git a/modemdr/journaline.cpp b/modemdr/journaline.cpp index 57704efc2..32fe64961 100644 --- a/modemdr/journaline.cpp +++ b/modemdr/journaline.cpp @@ -178,9 +178,15 @@ bool JournalineDecoder::push(const std::vector& dataUnit) if (crcPresent) { + if (end < 4U) + { + ++m_invalidDataUnits; + return false; + } + const std::uint16_t crc = static_cast((dataUnit[end - 2U] << 8) | dataUnit[end - 1U]); - if (end < 4U || CRC::crc16(dataUnit.data(), end - 2U) != crc) + if (CRC::crc16(dataUnit.data(), end - 2U) != crc) { ++m_invalidDataUnits; return false; @@ -231,6 +237,10 @@ bool JournalineDecoder::push(const std::vector& dataUnit) } } + if (oldest == m_received.end()) { + break; + } + m_objects.erase(oldest->first); m_received.erase(oldest); } diff --git a/modemdvb/dvbs2receiver.cpp b/modemdvb/dvbs2receiver.cpp index 3bacecaa0..d81492e10 100644 --- a/modemdvb/dvbs2receiver.cpp +++ b/modemdvb/dvbs2receiver.cpp @@ -20,6 +20,7 @@ #include #include #include +#include #include "util/profiler.h" #include "dvbs2receiver.h" @@ -892,6 +893,10 @@ void Receiver::deframe(FrameSlot& slot) { const XFECFrame& frame = slot.m_frame; const int kbch = frame.m_vlsnr >= 0 ? vlsnrKbch(frame.m_vlsnr) : dvbt2::kbch(frame.m_fecType, frame.m_rate, CodeFamily::S2); + if (kbch <= 0) { + qWarning() << "Receiver::deframe: Invalid BCH information length" << kbch; + return; + } const bool bad = slot.m_corrected < 0; dvbt2::scrambleBytes(slot.m_packed.data(), kbch / 8); dvbt2::BBFrameDecoder::Header header; diff --git a/modemdvb/dvbt2fec.cpp b/modemdvb/dvbt2fec.cpp index 753184671..abaffefac 100644 --- a/modemdvb/dvbt2fec.cpp +++ b/modemdvb/dvbt2fec.cpp @@ -26,6 +26,8 @@ #include #include +#include + #include "dvbt2fec.h" #include "dvbt2ldpc.h" @@ -728,6 +730,19 @@ const int *CellMapper::demuxTable(CodeRate rate, Constellation constellation, FE void cellBitMap(FECType type, CodeRate rate, Constellation constellation, std::vector& map) { + switch (constellation) + { + case Constellation::QPSK: + case Constellation::QAM16: + case Constellation::QAM64: + case Constellation::QAM256: + break; + default: + qWarning() << "cellBitMap: Invalid constellation" << static_cast(constellation); + map.clear(); + return; + } + const int n = nldpc(type); const int k = kldpc(type, rate); const int qldpc = (n - k) / 360; @@ -1030,7 +1045,8 @@ int L1Codec::postTableIndex(L1Constellation constellation) L1Codec::L1Codec() : m_preLDPC(FECType::Short, CodeRate::R1_4), m_postLDPC(FECType::Short, CodeRate::R1_2), - m_bch(FECType::Short, 12) + m_bch(FECType::Short, 12), + m_postBlock() { layout(m_preKsig, m_preKbch, m_preKldpc, 16200 - m_preKldpc, m_preNpunc, m_preGroups, m_preParity, m_preBlock); } diff --git a/modemdvb/dvbt2ofdm.cpp b/modemdvb/dvbt2ofdm.cpp index 94ebc5051..979998aab 100644 --- a/modemdvb/dvbt2ofdm.cpp +++ b/modemdvb/dvbt2ofdm.cpp @@ -108,7 +108,10 @@ OFDMDemod::OFDMDemod(int bandwidthHz, FFTFactory *fftFactory) : m_sampleRate(sampleRate(bandwidthHz)), m_p2Tables(nullptr), m_tables(nullptr), - m_interpolationSpacing(0) + m_interpolationSpacing(0), + m_gridSpacing(0), + m_gridOffset(0), + m_gridAmplitude(0.0f) { m_fft.m_factory = fftFactory; m_p1Fft.m_factory = fftFactory; diff --git a/modemdvb/dvbt2receiver.cpp b/modemdvb/dvbt2receiver.cpp index 59f17e31b..974b88034 100644 --- a/modemdvb/dvbt2receiver.cpp +++ b/modemdvb/dvbt2receiver.cpp @@ -20,6 +20,7 @@ #include #include #include +#include #include "util/profiler.h" @@ -1182,6 +1183,19 @@ void Receiver::analyseBlock(FEC& fec, int block, const uint8_t *packed) return; } + switch (fec.m_constellation) + { + case Constellation::QPSK: + case Constellation::QAM16: + case Constellation::QAM64: + case Constellation::QAM256: + break; + default: + qWarning() << "Receiver::analyseBlock: Invalid constellation" + << static_cast(fec.m_constellation); + return; + } + LDPC& ldpc = *fec.m_ldpc; const int k = ldpc.k(); const int eta = bitsPerCell(fec.m_constellation); diff --git a/modemdvb/dvbtinner.cpp b/modemdvb/dvbtinner.cpp index 1c111ebfe..ed27c944d 100644 --- a/modemdvb/dvbtinner.cpp +++ b/modemdvb/dvbtinner.cpp @@ -18,6 +18,7 @@ #include #include +#include #include "dvbtinner.h" @@ -88,6 +89,18 @@ float InnerDecoder::normalisation(Constellation constellation, Hierarchy hierarc void InnerDecoder::configure(Mode mode, Constellation constellation, CodeRate codeRate, Hierarchy hierarchy, bool lowPriority) { + switch (constellation) + { + case Constellation::QPSK: + case Constellation::QAM16: + case Constellation::QAM64: + break; + default: + qWarning() << "InnerDecoder::configure: Invalid constellation" + << static_cast(constellation); + return; + } + const Tables& tables = Tables::get(mode); m_mode = mode; diff --git a/modemdvb/dvbtmodulator.cpp b/modemdvb/dvbtmodulator.cpp index b746ada1d..f2c188ca0 100644 --- a/modemdvb/dvbtmodulator.cpp +++ b/modemdvb/dvbtmodulator.cpp @@ -39,6 +39,7 @@ Modulator::Modulator(Mode mode, Constellation constellation, CodeRate codeRate, m_tables(Tables::get(mode)), m_hierarchy(constellation == Constellation::QPSK ? Hierarchy::None : hierarchy), m_lpCodeRate(lpCodeRate), + m_tpsBits{}, m_symbolIndex(0), m_frameNumber(0) { diff --git a/modemdvb/dvbtofdm.cpp b/modemdvb/dvbtofdm.cpp index 63b453daa..03428ac59 100644 --- a/modemdvb/dvbtofdm.cpp +++ b/modemdvb/dvbtofdm.cpp @@ -232,7 +232,14 @@ OFDMDemod::OFDMDemod(int bandwidthHz, FFTFactory *fftFactory) : m_guardSize(0), m_symbolSize(0), m_kMax(0), - m_backoff(0) + m_backoff(0), + m_ring{}, + m_smoothingCutoff(0.0), + m_noiseConstellation(Constellation::QPSK), + m_lastSPPhase(0), + m_spPhaseRun(0), + m_tpsSync(0), + m_tpsBits{} { m_fft.m_factory = fftFactory; m_cirFft.m_factory = fftFactory; diff --git a/modemdvb/dvbtouter.cpp b/modemdvb/dvbtouter.cpp index 132ce9a28..2805dee92 100644 --- a/modemdvb/dvbtouter.cpp +++ b/modemdvb/dvbtouter.cpp @@ -118,6 +118,7 @@ std::vector OuterDecoder::makePRBS() } OuterDecoder::OuterDecoder() : + m_packet{}, m_prbs(makePRBS()) { for (int j = 0; j < m_interleaverI; j++) { diff --git a/plugins/channelrx/demod802.15.4/ieee_802_15_4_demodreceiver.cpp b/plugins/channelrx/demod802.15.4/ieee_802_15_4_demodreceiver.cpp index 7fbe8a942..ed5f3b196 100644 --- a/plugins/channelrx/demod802.15.4/ieee_802_15_4_demodreceiver.cpp +++ b/plugins/channelrx/demod802.15.4/ieee_802_15_4_demodreceiver.cpp @@ -37,6 +37,28 @@ IEEE_802_15_4_DemodReceiver::IEEE_802_15_4_DemodReceiver() : m_nonCoherentLane(true), m_mask(0), m_n(0), + m_waitMax(0.0f), + m_waitMaxN(0), + m_omega(0.0), + m_ncoRef(0), + m_dNext(0), + m_yNext(0), + m_tau(0.0), + m_phi(0.0), + m_dphi(0.0), + m_phaseInit(false), + m_frameStart(0), + m_powerSum(0.0), + m_powerCount(0), + m_qSum(0.0), + m_qCount(0), + m_ampSum(0.0), + m_ampSumSq(0.0), + m_ampCount(0), + m_acquisitionN(0), + m_detectorCleared(false), + m_framers{}, + m_prevECoh(0), m_crcScopeCount(0) { m_stats = Statistics{0, 0, 0, 0, 0, 0}; diff --git a/plugins/channelrx/demodapt/aptdemod.cpp b/plugins/channelrx/demodapt/aptdemod.cpp index be6ace9ae..8cb58d99d 100644 --- a/plugins/channelrx/demodapt/aptdemod.cpp +++ b/plugins/channelrx/demodapt/aptdemod.cpp @@ -734,9 +734,9 @@ int APTDemod::webapiActionsPost( { SWGSDRangel::SWGAPTDemodActions_aos* aos = swgAPTDemodActions->getAos(); QString *satelliteName = aos->getSatelliteName(); - qDebug() << "APTDemod::webapiActionsPost - AOS " << *satelliteName; if (satelliteName != nullptr) { + qDebug() << "APTDemod::webapiActionsPost - AOS " << *satelliteName; if (matchSatellite(*satelliteName)) { // Reset for new pass @@ -775,10 +775,10 @@ int APTDemod::webapiActionsPost( { SWGSDRangel::SWGAPTDemodActions_los* los = swgAPTDemodActions->getLos(); QString *satelliteName = los->getSatelliteName(); - qDebug() << "APTDemod::webapiActionsPost - LOS " << *satelliteName; if (satelliteName != nullptr) { + qDebug() << "APTDemod::webapiActionsPost - LOS " << *satelliteName; if (matchSatellite(*satelliteName)) { // Save image diff --git a/plugins/channelrx/demodapt/aptdemod.h b/plugins/channelrx/demodapt/aptdemod.h index 0766eba36..b27f5ccf5 100644 --- a/plugins/channelrx/demodapt/aptdemod.h +++ b/plugins/channelrx/demodapt/aptdemod.h @@ -144,6 +144,7 @@ public: MsgLine() : Message(), + m_line{}, m_size(APT_PROW_WIDTH) {} }; diff --git a/plugins/channelrx/demodapt/aptdemodsettings.cpp b/plugins/channelrx/demodapt/aptdemodsettings.cpp index 0bce80ac3..49c68e413 100644 --- a/plugins/channelrx/demodapt/aptdemodsettings.cpp +++ b/plugins/channelrx/demodapt/aptdemodsettings.cpp @@ -50,6 +50,7 @@ void APTDemodSettings::resetToDefaults() m_saveCombined = true; m_saveSeparate = false; m_saveProjection = false; + m_northToSouth = false; m_scanlinesPerImageUpdate = 20; m_transparencyThreshold = 100; m_opacityThreshold = 200; diff --git a/plugins/channelrx/demodapt/aptdemodsink.h b/plugins/channelrx/demodapt/aptdemodsink.h index f7eda42c7..ccf895098 100644 --- a/plugins/channelrx/demodapt/aptdemodsink.h +++ b/plugins/channelrx/demodapt/aptdemodsink.h @@ -45,6 +45,8 @@ class APTDemod; class APTDemodSink : public ChannelSampleSink { public: APTDemodSink(); + APTDemodSink(const APTDemodSink&) = delete; + APTDemodSink& operator=(const APTDemodSink&) = delete; ~APTDemodSink(); virtual void feed(const SampleVector::const_iterator& begin, const SampleVector::const_iterator& end); diff --git a/plugins/channelrx/demoddatv/leansdr/dvbs2.h b/plugins/channelrx/demoddatv/leansdr/dvbs2.h index 26b6d9ca7..e70e6fa37 100644 --- a/plugins/channelrx/demoddatv/leansdr/dvbs2.h +++ b/plugins/channelrx/demoddatv/leansdr/dvbs2.h @@ -3712,6 +3712,8 @@ struct s2_fecdec_helper : runnable ~s2_fecdec_helper() { killall(); // also deletes pools[mc][sf].procs if necessary + delete bitcount; + delete errcount; } void run() diff --git a/plugins/channelrx/demoddvb/dvbdemodepg.cpp b/plugins/channelrx/demoddvb/dvbdemodepg.cpp index dfca9cd84..afc2e2c92 100644 --- a/plugins/channelrx/demoddvb/dvbdemodepg.cpp +++ b/plugins/channelrx/demoddvb/dvbdemodepg.cpp @@ -114,6 +114,12 @@ int DVBDemodEPG::eitVersionKey(int sourceTable, int section) } DVBDemodEPG::DVBDemodEPG() : + m_nitSections{}, + m_sdtSections{}, + m_eitSections{}, + m_timeSections{}, + m_freesatSiSections{}, + m_freesatEitSections{}, m_freesatRegion(0), m_networkId(-1), m_transportStreamId(-1), diff --git a/plugins/channelrx/demoddvb/dvbdemodgui.cpp b/plugins/channelrx/demoddvb/dvbdemodgui.cpp index 5966a4839..3623fecc5 100644 --- a/plugins/channelrx/demoddvb/dvbdemodgui.cpp +++ b/plugins/channelrx/demoddvb/dvbdemodgui.cpp @@ -2801,7 +2801,7 @@ QString DVBDemodGUI::shortCodecName(const QString& name) // The codecs and picture size in the table, the A/V problems, and the mute button green while audio is playing void DVBDemodGUI::displayPlayerInfo(uint64_t tsOverflows) { - DTVVideoPlayer::Info info; + DTVVideoPlayer::Info info{}; if (m_player) { info = m_player->getInfo(); diff --git a/plugins/channelrx/demodinmarsat/inmarsatdemodsink.cpp b/plugins/channelrx/demodinmarsat/inmarsatdemodsink.cpp index c4bba48ab..1381be76f 100644 --- a/plugins/channelrx/demodinmarsat/inmarsatdemodsink.cpp +++ b/plugins/channelrx/demodinmarsat/inmarsatdemodsink.cpp @@ -315,6 +315,7 @@ Complex LMSEqualizer::processOneSample(Complex x, bool update, bool training) InmarsatDemodSink::InmarsatDemodSink(InmarsatDemod *stdCDemod) : m_scopeSink(nullptr), m_inmarsatDemod(stdCDemod), + m_channel(nullptr), m_channelSampleRate(InmarsatDemodSettings::CHANNEL_SAMPLE_RATE), m_channelFrequencyOffset(0), m_magsqSum(0.0f), @@ -329,6 +330,7 @@ InmarsatDemodSink::InmarsatDemodSink(InmarsatDemod *stdCDemod) : m_costasLoop(10*2*M_PI/100.0, 2), m_locked(false), m_rrcBufferIndex(0), + m_bits{}, m_sampleBufferIndexA(0), m_sampleBufferIndexB(0) { diff --git a/plugins/channelrx/demodmeshtastic/meshtasticdemod.cpp b/plugins/channelrx/demodmeshtastic/meshtasticdemod.cpp index 52b140f76..0ae5aefcc 100644 --- a/plugins/channelrx/demodmeshtastic/meshtasticdemod.cpp +++ b/plugins/channelrx/demodmeshtastic/meshtasticdemod.cpp @@ -82,14 +82,14 @@ MeshtasticDemod::MeshtasticDemod(DeviceAPI* deviceAPI) : m_lastMsgHeaderParityStatus(0), m_lastMsgPayloadCRC(false), m_lastMsgPayloadParityStatus(0), - m_udpSink(this, 256) + m_udpSink(this, 256), + m_networkManager(new QNetworkAccessManager()) { setObjectName(m_channelId); applySettings(m_settings, true); m_deviceAPI->addChannelSink(this); m_deviceAPI->addChannelSinkAPI(this); - m_networkManager = new QNetworkAccessManager(); QObject::connect( this, diff --git a/plugins/channelrx/demodwefax/wefaxdemodgui.cpp b/plugins/channelrx/demodwefax/wefaxdemodgui.cpp index 1c0b34dd1..fc8df0afc 100644 --- a/plugins/channelrx/demodwefax/wefaxdemodgui.cpp +++ b/plugins/channelrx/demodwefax/wefaxdemodgui.cpp @@ -695,7 +695,7 @@ bool WefaxDemodGUI::eventFilter(QObject *watched, QEvent *event) } if (delta != 0) { -#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) +#if QT_VERSION >= QT_VERSION_CHECK(5, 15, 0) const QPoint anchor = wheelEvent->position().toPoint(); #else const QPoint anchor = wheelEvent->pos(); diff --git a/plugins/channelrx/remotesink/remotesinkfifo.cpp b/plugins/channelrx/remotesink/remotesinkfifo.cpp index ea20ca182..6af8440e7 100644 --- a/plugins/channelrx/remotesink/remotesinkfifo.cpp +++ b/plugins/channelrx/remotesink/remotesinkfifo.cpp @@ -18,7 +18,11 @@ #include "remotesinkfifo.h" RemoteSinkFifo::RemoteSinkFifo(QObject *parent) : - QObject(parent) + QObject(parent), + m_size(0), + m_readHead(0), + m_servedHead(0), + m_writeHead(0) {} RemoteSinkFifo::RemoteSinkFifo(unsigned int size, QObject *parent) : diff --git a/plugins/channelrx/sigmffilesink/sigmffilesinkbaseband.cpp b/plugins/channelrx/sigmffilesink/sigmffilesinkbaseband.cpp index 607873326..83e1bbf02 100644 --- a/plugins/channelrx/sigmffilesink/sigmffilesinkbaseband.cpp +++ b/plugins/channelrx/sigmffilesink/sigmffilesinkbaseband.cpp @@ -31,9 +31,13 @@ MESSAGE_CLASS_DEFINITION(SigMFFileSinkBaseband::MsgConfigureSigMFFileSinkWork, M SigMFFileSinkBaseband::SigMFFileSinkBaseband() : m_channelizer(&m_sink), + m_spectrumSink(nullptr), + m_messageQueueToGUI(nullptr), m_specMax(0), m_squelchLevel(0), - m_squelchOpen(false) + m_squelchOpen(false), + m_centerFrequency(0), + m_timer(nullptr) { qDebug("SigMFFileSinkBaseband::SigMFFileSinkBaseband"); m_sampleFifo.setSize(SampleSinkFifo::getSizePolicy(48000)); diff --git a/plugins/channelrx/sigmffilesink/sigmffilesinksink.cpp b/plugins/channelrx/sigmffilesink/sigmffilesinksink.cpp index a7b2cfa77..d941e75d7 100644 --- a/plugins/channelrx/sigmffilesink/sigmffilesinksink.cpp +++ b/plugins/channelrx/sigmffilesink/sigmffilesinksink.cpp @@ -29,6 +29,10 @@ #include "sigmffilesinksink.h" SigMFFileSinkSink::SigMFFileSinkSink() : + m_channelSampleRate(0), + m_channelFrequencyOffset(0), + m_sinkSampleRate(0), + m_centerFrequency(0), m_preRecordBuffer(48000), m_preRecordFill(0), m_spectrumSink(nullptr), @@ -37,6 +41,7 @@ SigMFFileSinkSink::SigMFFileSinkSink() : m_record(false), m_squelchOpen(false), m_postSquelchCounter(0), + m_deviceUId(0), m_msCount(0), m_byteCount(0) {} diff --git a/plugins/channeltx/mod802.15.4/ieee_802_15_4_modsource.cpp b/plugins/channeltx/mod802.15.4/ieee_802_15_4_modsource.cpp index afb4081d3..d394b5912 100644 --- a/plugins/channeltx/mod802.15.4/ieee_802_15_4_modsource.cpp +++ b/plugins/channeltx/mod802.15.4/ieee_802_15_4_modsource.cpp @@ -519,7 +519,7 @@ int IEEE_802_15_4_ModSource::getChip() m_symbol = getSymbol(); if (m_settings.m_bitRate <= 40000) { - chip = IEEE_802_15_4_PHY::m_chipsBPSK[m_symbol][m_chipIdx]; + chip = IEEE_802_15_4_PHY::m_chipsBPSK[m_symbol & 1][m_chipIdx]; } else if (m_settings.m_subGHzBand) { chip = IEEE_802_15_4_PHY::m_chipsSubGHzOQPSK[m_symbol][m_chipIdx]; } else { diff --git a/plugins/feature/afc/afc.cpp b/plugins/feature/afc/afc.cpp index 6c292bb14..65b5a5722 100644 --- a/plugins/feature/afc/afc.cpp +++ b/plugins/feature/afc/afc.cpp @@ -317,6 +317,8 @@ void AFC::updateDeviceSetLists() if (getMessageQueueToGUI()) { getMessageQueueToGUI()->push(msg); + } else { + delete msg; } } diff --git a/plugins/feature/denoiser/denoiserworker.cpp b/plugins/feature/denoiser/denoiserworker.cpp index 20da5f2c9..bceffe532 100644 --- a/plugins/feature/denoiser/denoiserworker.cpp +++ b/plugins/feature/denoiser/denoiserworker.cpp @@ -46,7 +46,11 @@ DenoiserWorker::DenoiserWorker(QObject *parent) : m_recordSilenceNbSamples(0), m_recordSilenceCount(0), m_nbBytes(0), + m_rnnoiseIn{}, + m_rnnoiseOut{}, m_rnnoiseFill(0), + m_nvidiaIn{}, + m_nvidiaOut{}, m_nvidiaFill(0), m_nvidiaInitAttempted(false), m_nvidiaReady(false), @@ -54,8 +58,12 @@ DenoiserWorker::DenoiserWorker(QObject *parent) : m_nvidiaStatusReported(false), m_nvidiaGeneration(0), m_vst3Effect(nullptr), + m_vst3Input{}, + m_vst3Output{}, m_vst3Fill(0), - m_vst3FailureReported(false) + m_vst3FailureReported(false), + m_rmsLevel(0.0), + m_peakLevelOut(0.0) { m_audioBuffer.resize(4800); m_audioBufferFill = 0; diff --git a/plugins/feature/mcpserver/mcptools.cpp b/plugins/feature/mcpserver/mcptools.cpp index 4b7992bba..31d33855e 100644 --- a/plugins/feature/mcpserver/mcptools.cpp +++ b/plugins/feature/mcpserver/mcptools.cpp @@ -6193,6 +6193,11 @@ void MCPTools::registerIntentTools() return result; }); + QJsonObject gainValuesList = prop("array", "For a device type this does not know: the gain values to try, in the key's own units, lowest first"); + QJsonObject gainValuesItems; + gainValuesItems["type"] = "number"; + gainValuesList["items"] = gainValuesItems; + add("tune_gain", "Find the receiver gain that gives the best signal to noise ratio and apply it: steps the device through its gain range " "and at each step measures the noise floor and the strongest signal on the main spectrum. Too little gain leaves weak " @@ -6212,7 +6217,7 @@ void MCPTools::registerIntentTools() {"apply", prop("boolean", "Apply the chosen gain. false measures and reports but puts the gain back as it was. Default true")}, {"autoscale", prop("boolean", "Once the chosen gain is applied, set the main spectrum's reference level and range from what it then shows, as spectrum_action autoscale does, so the display suits the new gain. Default true")}, {"gainKey", strProp("For a device type this does not know: the settings key of its gain, from describe_settings. Then give values too")}, - {"values", prop("array", "For a device type this does not know: the gain values to try, in the key's own units, lowest first")}, + {"values", gainValuesList}, {"agcKey", strProp("For a device type this does not know: the settings key that turns its AGC off when set to 0")} }, {"deviceSetIndex"}), [this](const QJsonObject& args) { return tuneGain(args); }); diff --git a/plugins/feature/morsedecoder/morsedecoder.h b/plugins/feature/morsedecoder/morsedecoder.h index 5e7a1aa62..98d9e474c 100644 --- a/plugins/feature/morsedecoder/morsedecoder.h +++ b/plugins/feature/morsedecoder/morsedecoder.h @@ -171,6 +171,10 @@ public: QString m_text; MsgReportText(const QString& text) : + m_estimatedPitchHz(0.0f), + m_estimatedSpeedWPM(0.0f), + m_signalThreshold(0.0f), + m_costFunction(0.0f), m_text(text) {} }; diff --git a/plugins/feature/morsedecoder/morsedecodersettings.cpp b/plugins/feature/morsedecoder/morsedecodersettings.cpp index e62a0b67f..881cc08b5 100644 --- a/plugins/feature/morsedecoder/morsedecodersettings.cpp +++ b/plugins/feature/morsedecoder/morsedecodersettings.cpp @@ -32,6 +32,7 @@ const QStringList MorseDecoderSettings::m_channelURIs = { }; MorseDecoderSettings::MorseDecoderSettings() : + m_scopeGUI(nullptr), m_rollupState(nullptr) { resetToDefaults(); diff --git a/plugins/feature/satellitetracker/satellitetrackersgp4.cpp b/plugins/feature/satellitetracker/satellitetrackersgp4.cpp index c8afa0f38..3f1956524 100644 --- a/plugins/feature/satellitetracker/satellitetrackersgp4.cpp +++ b/plugins/feature/satellitetracker/satellitetrackersgp4.cpp @@ -198,7 +198,7 @@ bool getPassesThrough0Deg(const QString& tle0, const QString& tle1, const QStrin double timeStep = (losTime - aosTime).TotalSeconds() / steps; - double prevAz; + double prevAz = 0.0; for (int i = 0; i < steps; i++) { // Calculate satellite position diff --git a/plugins/feature/startracker/startrackerworker.cpp b/plugins/feature/startracker/startrackerworker.cpp index 5d444ff14..c4f52fa7b 100644 --- a/plugins/feature/startracker/startrackerworker.cpp +++ b/plugins/feature/startracker/startrackerworker.cpp @@ -610,8 +610,8 @@ bool StarTrackerWorker::getRAFromHorizons(const QDateTime &dateTime, RADec &rdJ2 void StarTrackerWorker::update() { - AzAlt aa, sunAA, moonAA; - RADec rdJnow, sunRD, moonRD; + AzAlt aa{}, sunAA{}, moonAA; + RADec rdJnow, sunRD{}, moonRD; bool rdJnowValid = false; double l, b; bool lbTarget = false; @@ -988,7 +988,7 @@ void StarTrackerWorker::update() for (int step = 0; step <= 24*60*60/timestep; step++) { - AzAlt aa; + AzAlt aa{}; RADec rdJnow, rdJ2000; // Calculate elevation of desired object diff --git a/plugins/samplemimo/limesdrmimo/limesdrmithread.cpp b/plugins/samplemimo/limesdrmimo/limesdrmithread.cpp index 46e244a48..87187cf64 100644 --- a/plugins/samplemimo/limesdrmimo/limesdrmithread.cpp +++ b/plugins/samplemimo/limesdrmimo/limesdrmithread.cpp @@ -24,7 +24,10 @@ LimeSDRMIThread::LimeSDRMIThread(lms_stream_t* stream0, lms_stream_t* stream1, Q m_running(false), m_stream0(stream0), m_stream1(stream1), + m_buf0{}, + m_buf1{}, m_sampleFifo(nullptr), + m_log2Decim(0), m_iqOrder(true) { setObjectName("LimeSDRMI"); diff --git a/plugins/samplemimo/limesdrmimo/limesdrmothread.cpp b/plugins/samplemimo/limesdrmimo/limesdrmothread.cpp index 4c9e8951c..b9257d87e 100644 --- a/plugins/samplemimo/limesdrmimo/limesdrmothread.cpp +++ b/plugins/samplemimo/limesdrmimo/limesdrmothread.cpp @@ -25,7 +25,9 @@ LimeSDRMOThread::LimeSDRMOThread(lms_stream_t* stream0, lms_stream_t* stream1, Q m_running(false), m_stream0(stream0), m_stream1(stream1), - m_sampleFifo(nullptr) + m_buf(nullptr), + m_sampleFifo(nullptr), + m_log2Interp(0) { qDebug("LimeSDRMOThread::LimeSDRMOThread"); m_buf = new qint16[2*DeviceLimeSDR::blockSize*2]; diff --git a/plugins/samplesink/remoteoutput/remoteoutputfifo.cpp b/plugins/samplesink/remoteoutput/remoteoutputfifo.cpp index de0faea5e..4b332eeed 100644 --- a/plugins/samplesink/remoteoutput/remoteoutputfifo.cpp +++ b/plugins/samplesink/remoteoutput/remoteoutputfifo.cpp @@ -18,7 +18,11 @@ #include "remoteoutputfifo.h" RemoteOutputFifo::RemoteOutputFifo(QObject *parent) : - QObject(parent) + QObject(parent), + m_size(0), + m_readHead(0), + m_servedHead(0), + m_writeHead(0) {} RemoteOutputFifo::RemoteOutputFifo(unsigned int size, QObject *parent) : diff --git a/plugins/samplesink/remoteoutput/udpsinkfec.cpp b/plugins/samplesink/remoteoutput/udpsinkfec.cpp index 4f9b40b9c..0dbfca820 100644 --- a/plugins/samplesink/remoteoutput/udpsinkfec.cpp +++ b/plugins/samplesink/remoteoutput/udpsinkfec.cpp @@ -37,6 +37,7 @@ UDPSinkFEC::UDPSinkFEC() : m_txBlockIndex(0), m_frameCount(0), m_sampleIndex(0), + m_deviceIndex(0), m_remoteOutputSender(nullptr), m_senderThread(nullptr), m_remoteAddress("127.0.0.1"), diff --git a/plugins/samplesource/remoteinput/remoteinputbuffer.h b/plugins/samplesource/remoteinput/remoteinputbuffer.h index d0a5eafcc..f41afaee1 100644 --- a/plugins/samplesource/remoteinput/remoteinputbuffer.h +++ b/plugins/samplesource/remoteinput/remoteinputbuffer.h @@ -136,7 +136,17 @@ private: int m_recoveryCount; //!< number of recovery blocks received bool m_decoded; //!< true if decoded bool m_metaRetrieved; //!< true if meta data (block zero) was retrieved - DecoderSlot() {} + DecoderSlot() : + m_blockZero{}, + m_originalBlocks{}, + m_recoveryBlocks{}, + m_cm256DescriptorBlocks{}, + m_blockCount(0), + m_originalCount(0), + m_recoveryCount(0), + m_decoded(false), + m_metaRetrieved(false) + {} }; RemoteMetaDataFEC m_currentMeta; //!< Stored current meta data diff --git a/plugins/samplesource/sigmffileinput/sigmffiledata.h b/plugins/samplesource/sigmffileinput/sigmffiledata.h index bc4fccd6b..cf9f6d4c1 100644 --- a/plugins/samplesource/sigmffileinput/sigmffiledata.h +++ b/plugins/samplesource/sigmffileinput/sigmffiledata.h @@ -93,7 +93,14 @@ public: unsigned int m_nbCaptures; unsigned int m_nbAnnotations; - SigMFFileMetaInfo() + SigMFFileMetaInfo() : + m_totalSamples(0), + m_totalTimeMs(0), + m_coreSampleRate(0.0), + m_offset(0), + m_rxBits(0), + m_nbCaptures(0), + m_nbAnnotations(0) {} SigMFFileMetaInfo(const SigMFFileMetaInfo& other) : diff --git a/plugins/samplesource/sigmffileinput/sigmffileinputworker.cpp b/plugins/samplesource/sigmffileinput/sigmffileinputworker.cpp index ae8225c12..4334b3357 100644 --- a/plugins/samplesource/sigmffileinput/sigmffileinputworker.cpp +++ b/plugins/samplesource/sigmffileinput/sigmffileinputworker.cpp @@ -35,22 +35,25 @@ SigMFFileInputWorker::SigMFFileInputWorker(std::ifstream *samplesStream, const QTimer& timer, MessageQueue *fileInputMessageQueue, QObject* parent) : - QObject(parent), - m_running(false), + QObject(parent), + m_running(false), + m_metaInfo(nullptr), + m_captures(nullptr), m_currentTrackIndex(0), - m_ifstream(samplesStream), - m_fileBuf(0), - m_convertBuf(0), - m_bufsize(0), - m_chunksize(0), - m_sampleFifo(sampleFifo), - m_samplesCount(0), - m_timer(timer), - m_fileInputMessageQueue(fileInputMessageQueue), + m_ifstream(samplesStream), + m_fileBuf(0), + m_convertBuf(0), + m_bufsize(0), + m_chunksize(0), + m_sampleFifo(sampleFifo), + m_samplesCount(0), + m_totalSamples(0), + m_timer(timer), + m_fileInputMessageQueue(fileInputMessageQueue), m_samplerate(48000), m_accelerationFactor(1), - m_samplesize(16), - m_samplebytes(2), + m_samplesize(16), + m_samplebytes(2), m_throttlems(FILESOURCE_THROTTLE_MS), m_throttleToggle(false), m_sigMFConverter(nullptr) diff --git a/sdrbase/dtv/dtvcarousel.cpp b/sdrbase/dtv/dtvcarousel.cpp index 9bedea766..62252f132 100644 --- a/sdrbase/dtv/dtvcarousel.cpp +++ b/sdrbase/dtv/dtvcarousel.cpp @@ -293,12 +293,20 @@ void DTVCarousel::dii(const uint8_t *m, int length, uint32_t transactionId) const int userInfoLength = ri.u8(); const uint8_t *userInfo = ri.bytes(userInfoLength); - for (int d = 0; userInfo && (d + 2 <= userInfoLength); d += 2 + userInfo[d + 1]) + for (int d = 0; userInfo && (d + 2 <= userInfoLength); ) { + const int descriptorLength = userInfo[d + 1]; + + if (descriptorLength > userInfoLength - d - 2) { + break; + } + // compressed_module_descriptor: compression_method (zlib), original_size if ((userInfo[d] == m_compressedModuleDescriptor) && (userInfo[d + 1] >= 5) && (d + 7 <= userInfoLength)) { originalSize = (int) std::min(0x7FFFFFFF, ((uint32_t) userInfo[d + 3] << 24) | (userInfo[d + 4] << 16) | (userInfo[d + 5] << 8) | userInfo[d + 6]); } + + d += 2 + descriptorLength; } if ((moduleSize > m_maxModuleSize) || (originalSize > m_maxModuleSize)) { diff --git a/sdrbase/dtv/dtvpsi.cpp b/sdrbase/dtv/dtvpsi.cpp index cfb371bbf..d0172ea47 100644 --- a/sdrbase/dtv/dtvpsi.cpp +++ b/sdrbase/dtv/dtvpsi.cpp @@ -17,11 +17,14 @@ /////////////////////////////////////////////////////////////////////////////////// #include +#include #include "dtv/dtvpsi.h" #include "dtv/dtvsections.h" DTVPSI::DTVPSI() : + m_pat(), + m_nit(), m_transportStreamId(-1) { } @@ -44,9 +47,20 @@ const std::map& DTVPSI::getChannels() const void DTVPSI::feed(const uint8_t *data, int length) { + if (!data || length <= 0) { + return; + } + // Complete a packet split between feeds if (!m_partial.empty()) { + if (m_partial.size() >= 188) + { + qWarning() << "DTVPSI::feed: m_partial size is unexpectedly" + << m_partial.size(); + return; + } + int needed = std::min(188 - (int) m_partial.size(), length); m_partial.insert(m_partial.end(), data, data + needed); data += needed; diff --git a/sdrbase/dtv/dtvrecorder.cpp b/sdrbase/dtv/dtvrecorder.cpp index d1efd3dd0..587b7fe41 100644 --- a/sdrbase/dtv/dtvrecorder.cpp +++ b/sdrbase/dtv/dtvrecorder.cpp @@ -27,6 +27,8 @@ DTVRecorder::DTVRecorder() : m_mode(Multiplex), m_serviceId(0), m_started(false), + m_patSections(), + m_pmtSections(), m_transportStreamId(-1), m_pmtPid(-1), m_pmtVersion(-1), diff --git a/sdrbase/dtv/dtvudp.cpp b/sdrbase/dtv/dtvudp.cpp index 87c887ddc..1c46c2eed 100644 --- a/sdrbase/dtv/dtvudp.cpp +++ b/sdrbase/dtv/dtvudp.cpp @@ -25,6 +25,7 @@ DTVUDP::DTVUDP() : m_port(5004), + m_datagram{}, m_datagramFill(0), m_datagrams(0), m_address(QHostAddress::LocalHost), diff --git a/sdrbase/util/osndb.h b/sdrbase/util/osndb.h index 6c9f981d9..246a04a26 100644 --- a/sdrbase/util/osndb.h +++ b/sdrbase/util/osndb.h @@ -56,6 +56,11 @@ struct SDRBASE_API AircraftInformation { QString m_operatorICAO; QString m_registered; + AircraftInformation() : + m_icao(0) + { + } + static void init() { QMutexLocker locker(&m_mutex); diff --git a/sdrbench/test_ft8protocols.cpp b/sdrbench/test_ft8protocols.cpp index 5aa632847..419f165b7 100644 --- a/sdrbench/test_ft8protocols.cpp +++ b/sdrbench/test_ft8protocols.cpp @@ -275,6 +275,8 @@ void TestFT8Protocols::testOnesZeroes(const QStringList& argElements) } qInfo("TestFT8Protocols::testOnesZeroes: (%d,%d) index: zeroes, ones:\n%s", nbBits, bitIndex, qPrintable(s)); + delete[] ones; + delete[] zeroes; } void TestFT8Protocols::testSoftDecode(const QStringList& argElements) diff --git a/sdrgui/dtv/dtvvideoplayer.h b/sdrgui/dtv/dtvvideoplayer.h index 9947e3700..c5047dad2 100644 --- a/sdrgui/dtv/dtvvideoplayer.h +++ b/sdrgui/dtv/dtvvideoplayer.h @@ -88,13 +88,13 @@ public: QString m_videoCodec; //!< FFmpeg's long name QString m_videoDecoder; //!< The GPU's (e.g. CUDA, D3D11VA), or empty if decoded in software QString m_audioCodec; - int m_width; - int m_height; + int m_width = 0; + int m_height = 0; uint64_t m_videoFrames; - uint64_t m_audioFrames; + uint64_t m_audioFrames = 0; uint64_t m_decodeErrors; uint64_t m_lateFrames; //!< Not shown, as they were too late - bool m_audioDescription; //!< Audio description is being mixed in + bool m_audioDescription = false; //!< Audio description is being mixed in uint64_t m_adFrames; //!< Audio description frames decoded int m_adFade; //!< Latest fade of the main audio, from the audio description (0 to 255) bool m_subtitles; //!< A subtitle stream is being decoded diff --git a/sdrgui/gui/glshadercolormap.cpp b/sdrgui/gui/glshadercolormap.cpp index 4ded61cdc..e0c7dd6cb 100644 --- a/sdrgui/gui/glshadercolormap.cpp +++ b/sdrgui/gui/glshadercolormap.cpp @@ -126,7 +126,11 @@ void GLShaderColorMap::initColorMapTextureImmutable(const QString &colorMapName) GLfloat *colorMap = (GLfloat *)ColorMap::getColorMap(colorMapName); if (colorMap) { +#if (QT_VERSION >= QT_VERSION_CHECK(5, 3, 0)) + m_colorMapTexture->setData(QOpenGLTexture::RGB, QOpenGLTexture::Float32, static_cast(colorMap)); +#else m_colorMapTexture->setData(QOpenGLTexture::RGB, QOpenGLTexture::Float32, colorMap); +#endif } else { qDebug() << "GLShaderColorMap::initColorMapTextureImmutable: colorMap " << colorMapName << " not supported"; } diff --git a/sdrgui/gui/glshaderspectrogram.cpp b/sdrgui/gui/glshaderspectrogram.cpp index 5d95c8f9c..0e10c55c9 100644 --- a/sdrgui/gui/glshaderspectrogram.cpp +++ b/sdrgui/gui/glshaderspectrogram.cpp @@ -279,7 +279,11 @@ void GLShaderSpectrogram::initColorMapTextureImmutable(const QString &colorMapNa GLfloat *colorMap = (GLfloat *)ColorMap::getColorMap(colorMapName); if (colorMap) { +#if (QT_VERSION >= QT_VERSION_CHECK(5, 3, 0)) + m_colorMapTexture->setData(QOpenGLTexture::RGB, QOpenGLTexture::Float32, static_cast(colorMap)); +#else m_colorMapTexture->setData(QOpenGLTexture::RGB, QOpenGLTexture::Float32, colorMap); +#endif } else { qDebug() << "GLShaderSpectrogram::initColorMapTextureImmutable: colorMap " << colorMapName << " not supported"; } diff --git a/sdrgui/gui/scidoublespinbox.cpp b/sdrgui/gui/scidoublespinbox.cpp index 5a0f0d01a..65a94e922 100644 --- a/sdrgui/gui/scidoublespinbox.cpp +++ b/sdrgui/gui/scidoublespinbox.cpp @@ -35,7 +35,7 @@ QValidator::State SciDoubleSpinBox::validate(QString &input, int &pos) const (void) pos; bool ok; - input.toDouble(&ok); + (void) input.toDouble(&ok); if (ok) { return QValidator::Acceptable; } diff --git a/sdrgui/gui/spectrummeasurements.cpp b/sdrgui/gui/spectrummeasurements.cpp index 447b29432..56f56626a 100644 --- a/sdrgui/gui/spectrummeasurements.cpp +++ b/sdrgui/gui/spectrummeasurements.cpp @@ -403,7 +403,7 @@ void SpectrumMeasurements::createMaskTable(unsigned memMask) int row = 0; for (int i = 0; i < 32; i++) { - if ((memMask & (1 << i)) != 0) + if ((memMask & (1U << i)) != 0) { m_maskTable->setVerticalHeaderItem(row, new QTableWidgetItem(QString("M%1").arg(i + 1)));