mirror of
https://github.com/esphome/esphome.git
synced 2024-12-21 16:27:44 +01:00
[online_image]Don't access decoder if not initialized (#7882)
This commit is contained in:
parent
e623989878
commit
3bac45e737
@ -49,6 +49,10 @@ void PngDecoder::prepare(uint32_t download_size) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
int HOT PngDecoder::decode(uint8_t *buffer, size_t 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_) {
|
if (size < 256 && size < this->download_size_ - this->decoded_bytes_) {
|
||||||
ESP_LOGD(TAG, "Waiting for data");
|
ESP_LOGD(TAG, "Waiting for data");
|
||||||
return 0;
|
return 0;
|
||||||
|
Loading…
Reference in New Issue
Block a user