1
0
mirror of https://github.com/gnss-sdr/gnss-sdr synced 2024-10-31 23:26:22 +00:00

Avoid segmentation fault due to misconfiguration

This commit is contained in:
Carles Fernandez 2022-06-08 17:10:34 +02:00
parent 96803c1d0f
commit f076c6afd9
No known key found for this signature in database
GPG Key ID: 4C583C52B0C3877D

View File

@ -118,6 +118,14 @@ void GNSSFlowgraph::init()
int sources_count_deprecated = configuration_->property("Receiver.sources_count", 1); int sources_count_deprecated = configuration_->property("Receiver.sources_count", 1);
sources_count_ = configuration_->property("GNSS-SDR.num_sources", sources_count_deprecated); sources_count_ = configuration_->property("GNSS-SDR.num_sources", sources_count_deprecated);
// Avoid segmentation fault caused by wrong configuration
if (sources_count_ == 2 && block_factory->GetSignalSource(configuration_.get(), queue_.get(), 0)->implementation() == "Multichannel_File_Signal_Source")
{
std::cout << " * Please set GNSS-SDR.num_sources=1 in your configuraiion file\n";
std::cout << " if you are using the Multichannel_File_Signal_Source implementation.\n";
sources_count_ = 1;
}
int signal_conditioner_ID = 0; int signal_conditioner_ID = 0;
for (int i = 0; i < sources_count_; i++) for (int i = 0; i < sources_count_; i++)