Skip to content

Commit

Permalink
Some extra checks
Browse files Browse the repository at this point in the history
  • Loading branch information
mmosca committed Jun 21, 2024
1 parent 978818b commit c43262e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/main/rx/crsf.c
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,7 @@ STATIC_UNIT_TESTED uint8_t crsfFrameStatus(rxRuntimeConfig_t *rxRuntimeConfig)
return RX_FRAME_PENDING;
}

int channelCount = 16;
int channelCount = 0;

switch(rcChannelsHeader->resolution) {
case CRSF_11_BIT:
Expand Down Expand Up @@ -306,7 +306,7 @@ STATIC_UNIT_TESTED uint8_t crsfFrameStatus(rxRuntimeConfig_t *rxRuntimeConfig)
return RX_FRAME_PENDING;
}

if(crsfFrame.frame.frameLength != payloadSize + CRSF_FRAME_LENGTH_TYPE_CRC) { // TYPE_CRC or _CRC?
if(crsfFrame.frame.frameLength != payloadSize + CRSF_FRAME_LENGTH_TYPE_CRC || channelCount == 0) { // TYPE_CRC or _CRC?
return RX_FRAME_PENDING;
}

Expand Down

0 comments on commit c43262e

Please sign in to comment.