diff --git a/src/algorithms/libs/galileo_e6_signal_replica.cc b/src/algorithms/libs/galileo_e6_signal_replica.cc index d0e93fda7..4b84cad40 100644 --- a/src/algorithms/libs/galileo_e6_signal_replica.cc +++ b/src/algorithms/libs/galileo_e6_signal_replica.cc @@ -235,6 +235,10 @@ std::string galileo_e6_c_secondary_code(int32_t prn) { std::string dest(static_cast(GALILEO_E6_C_SECONDARY_CODE_LENGTH_CHIPS), '0'); const uint32_t prn_ = prn - 1; + if ((prn < 1) || (prn > 50)) + { + return dest; + } uint32_t index = 0; for (size_t i = 0; i < GALILEO_E6_C_SECONDARY_CODE_STR_LENGTH; i++) { diff --git a/src/algorithms/tracking/gnuradio_blocks/dll_pll_veml_tracking.cc b/src/algorithms/tracking/gnuradio_blocks/dll_pll_veml_tracking.cc index 92f11ded9..d0f9f550c 100644 --- a/src/algorithms/tracking/gnuradio_blocks/dll_pll_veml_tracking.cc +++ b/src/algorithms/tracking/gnuradio_blocks/dll_pll_veml_tracking.cc @@ -730,7 +730,7 @@ void dll_pll_veml_tracking::start_tracking() { if (d_trk_parameters.track_pilot) { - d_secondary_code_string = galileo_e6_c_secondary_code(d_acquisition_gnss_synchro->PRN - 1); + d_secondary_code_string = galileo_e6_c_secondary_code(d_acquisition_gnss_synchro->PRN); galileo_e6_b_code_gen_float_primary(d_data_code, d_acquisition_gnss_synchro->PRN); galileo_e6_c_code_gen_float_primary(d_tracking_code, d_acquisition_gnss_synchro->PRN); d_Prompt_Data[0] = gr_complex(0.0, 0.0);