mirror of
https://github.com/esphome/esphome.git
synced 2025-01-03 03:11:44 +01:00
[online_image]Don't access decoder if not initialized (#7882)
This commit is contained in:
parent
7cdf5b55ef
commit
beb8ab50e2
1 changed files with 4 additions and 0 deletions
|
@ -49,6 +49,10 @@ void PngDecoder::prepare(uint32_t download_size) {
|
|||
}
|
||||
|
||||
int HOT PngDecoder::decode(uint8_t *buffer, size_t size) {
|
||||
if (!this->pngle_) {
|
||||
ESP_LOGE(TAG, "PNG decoder engine not initialized!");
|
||||
return -1;
|
||||
}
|
||||
if (size < 256 && size < this->download_size_ - this->decoded_bytes_) {
|
||||
ESP_LOGD(TAG, "Waiting for data");
|
||||
return 0;
|
||||
|
|
Loading…
Reference in a new issue