fix(display): fix divide by stride of zero value (#8308)

Signed-off-by: zhouxingjian <zhouxingjian@xiaomi.com>
This commit is contained in:
caibutshuai
2025-06-02 18:49:51 +08:00
committed by GitHub
parent d290f4e8fe
commit 7ad7f41e32
+1
View File
@@ -476,6 +476,7 @@ void lv_display_set_buffers(lv_display_t * disp, void * buf1, void * buf2, uint3
uint32_t stride = lv_draw_buf_width_to_stride(w, cf);
if(render_mode == LV_DISPLAY_RENDER_MODE_PARTIAL) {
LV_ASSERT_FORMAT_MSG(stride != 0, "stride is 0, check your color format %d and width: %" LV_PRIu32, cf, w);
/* for partial mode, we calculate the height based on the buf_size and stride */
h = buf_size / stride;
LV_ASSERT_MSG(h != 0, "the buffer is too small");