From 05b2d5d1854a3ff4d028c032240a999509d9e732 Mon Sep 17 00:00:00 2001 From: gralpli <25158727+gralpli@users.noreply.github.com> Date: Fri, 27 Sep 2024 10:24:33 +0200 Subject: [PATCH] fix issue #34 --- components/ssd1306/ssd1306_i2c_new.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/ssd1306/ssd1306_i2c_new.c b/components/ssd1306/ssd1306_i2c_new.c index 0a8640b..4f3035c 100644 --- a/components/ssd1306/ssd1306_i2c_new.c +++ b/components/ssd1306/ssd1306_i2c_new.c @@ -169,7 +169,7 @@ void i2c_display_image(SSD1306_t * dev, int page, int seg, uint8_t * images, int } uint8_t *out_buf; - out_buf = malloc(width + 1); + out_buf = malloc(width < 4 ? 4 : width + 1); if (out_buf == NULL) { ESP_LOGE(TAG, "malloc fail"); return;