diff --git a/lvgl_tft/ili9488.c b/lvgl_tft/ili9488.c index feb9fba..28d6def 100644 --- a/lvgl_tft/ili9488.c +++ b/lvgl_tft/ili9488.c @@ -118,7 +118,7 @@ void ili9488_flush(lv_disp_drv_t * drv, const lv_area_t * area, lv_color_t * col lv_color16_t *buffer_16bit = (lv_color16_t *) color_map; uint8_t *mybuf; do { - mybuf = (uint8_t *) heap_caps_malloc(3 * size * sizeof(uint8_t), MALLOC_CAP_DMA); + mybuf = (uint8_t *) heap_caps_malloc(3 * size * sizeof(uint8_t) + 3, MALLOC_CAP_DMA); if (mybuf == NULL) ESP_LOGW(TAG, "Could not allocate enough DMA memory!"); } while (mybuf == NULL);