Skip to content

Commit

Permalink
Merge branch 'bugfix/i2c_lcd_pointer_risk' into 'master'
Browse files Browse the repository at this point in the history
bugfix(i2c_lcd): Fix risk that pointerto local outside scope

Closes IDF-9992

See merge request espressif/esp-idf!31112
  • Loading branch information
mythbuster5 committed May 28, 2024
2 parents b325a56 + 381cf16 commit 9ac85e1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion components/esp_lcd/i2c/esp_lcd_panel_io_i2c_v2.c
Original file line number Diff line number Diff line change
Expand Up @@ -160,8 +160,8 @@ static esp_err_t panel_io_i2c_tx_buffer(esp_lcd_panel_io_t *io, int lcd_cmd, con
uint8_t *cmd_buffer = NULL;
size_t cmd_buffer_size = 0;
// some displays don't want any additional commands on data transfers
uint8_t cmds[4] = {BYTESHIFT(lcd_cmd, 3), BYTESHIFT(lcd_cmd, 2), BYTESHIFT(lcd_cmd, 1), BYTESHIFT(lcd_cmd, 0)};
if (send_param) {
uint8_t cmds[4] = {BYTESHIFT(lcd_cmd, 3), BYTESHIFT(lcd_cmd, 2), BYTESHIFT(lcd_cmd, 1), BYTESHIFT(lcd_cmd, 0)};
size_t cmds_size = i2c_panel_io->lcd_cmd_bits / 8;
if (cmds_size > 0 && cmds_size <= sizeof(cmds)) {
cmd_buffer = cmds + (sizeof(cmds) - cmds_size);
Expand Down

0 comments on commit 9ac85e1

Please sign in to comment.