mirror of
https://github.com/gnss-sdr/gnss-sdr
synced 2026-10-09 01:01:50 +00:00
Fix off-by-one PRN guard in GPS/SBAS code generation
This commit is contained in:
@@ -45,7 +45,7 @@ void gps_l1_ca_code_gen_int(own::span<int32_t> dest, int32_t prn, uint32_t chip_
|
||||
// compute delay array index for given PRN number
|
||||
if (120 <= prn && prn <= 138)
|
||||
{
|
||||
prn_idx = prn - 88; // SBAS PRNs are at array indices 31 to 50 (offset: -120+33-1 =-88)
|
||||
prn_idx = prn - 88; // SBAS PRNs are at array indices 32 to 50 (offset: -120+33-1 =-88)
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -53,7 +53,7 @@ void gps_l1_ca_code_gen_int(own::span<int32_t> dest, int32_t prn, uint32_t chip_
|
||||
}
|
||||
|
||||
// A simple error check
|
||||
if ((prn_idx < 0) || (prn_idx > 51))
|
||||
if ((prn_idx < 0) || (prn_idx > 50))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
*
|
||||
* SBAS PRN codes (120–138) are generated by the GPS L1 C/A code generator
|
||||
* using SBAS-specific G2 initial state delays (index offset -88 into the
|
||||
* delays table, covering indices 31..50 for PRN 120..138).
|
||||
* delays table, covering indices 32..50 for PRN 120..138).
|
||||
*
|
||||
* -----------------------------------------------------------------------------
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user