Skip to content

Commit

Permalink
Merge pull request #89 from arneboe/fix_call_user_cb
Browse files Browse the repository at this point in the history
fix: do not invoke user_cb for unknown rdm pids
  • Loading branch information
someweisguy authored Aug 19, 2023
2 parents a949461 + 25d897f commit c3d8053
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/dmx/hal.c
Original file line number Diff line number Diff line change
Expand Up @@ -1084,7 +1084,7 @@ size_t dmx_receive(dmx_port_t dmx_num, dmx_packet_t *packet,
}

// Call the user-side callback
if (driver->rdm_cbs[cb_num].user_cb != NULL) {
if (cb_num < driver->num_rdm_cbs && driver->rdm_cbs[cb_num].user_cb != NULL) {
void *context = driver->rdm_cbs[cb_num].context;
driver->rdm_cbs[cb_num].user_cb(dmx_num, &header, context);
}
Expand Down

0 comments on commit c3d8053

Please sign in to comment.