mirror of
https://github.com/esphome/esphome.git
synced 2026-05-22 01:42:49 +08:00
[ili9xxx] Guard against null buffer in display_() when allocation fails (#15786)
This commit is contained in:
committed by
Jesse Hills
parent
81fb6712fe
commit
9cb2b562b9
@@ -1,5 +1,7 @@
|
||||
#pragma once
|
||||
|
||||
#include <cstdint>
|
||||
|
||||
namespace esphome {
|
||||
namespace ili9xxx {
|
||||
|
||||
|
||||
@@ -229,6 +229,10 @@ void ILI9XXXDisplay::update() {
|
||||
}
|
||||
|
||||
void ILI9XXXDisplay::display_() {
|
||||
// buffer may be null if allocation failed
|
||||
if (this->buffer_ == nullptr) {
|
||||
return;
|
||||
}
|
||||
// check if something was displayed
|
||||
if ((this->x_high_ < this->x_low_) || (this->y_high_ < this->y_low_)) {
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user