1
0
mirror of https://github.com/esphome/esphome.git synced 2025-01-18 20:10:55 +00:00

[online_image]Don't access decoder if not initialized (#7882)

This commit is contained in:
guillempages 2024-11-28 04:55:20 +01:00 committed by GitHub
parent 7cdf5b55ef
commit beb8ab50e2
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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;