MRAR source=5 is bogus, don't decode that.

This commit is contained in:
Oliver Jowett 2021-07-29 19:04:50 +08:00
parent e3a8e00412
commit cdc818a9f3
2 changed files with 3 additions and 2 deletions

View File

@ -783,7 +783,7 @@ static int decodeBDS44(struct modesMessage *mm, bool store)
unsigned humidity_valid = getbit(msg, 50);
unsigned humidity_raw = getbits(msg, 51, 56);
if (source == MRAR_SOURCE_INVALID || source > 5)
if (source == MRAR_SOURCE_INVALID || source >= MRAR_SOURCE_RESERVED)
return 0; // invalid or reserved source
if (!wind_valid || !sat_valid)

View File

@ -244,7 +244,8 @@ typedef enum {
MRAR_SOURCE_INS = 1,
MRAR_SOURCE_GNSS = 2,
MRAR_SOURCE_DMEDME = 3,
MRAR_SOURCE_VORDME = 4
MRAR_SOURCE_VORDME = 4,
MRAR_SOURCE_RESERVED = 5
} mrar_source_t;
// BDS4,4 and BDS4,5 hazard reports