mirror of
https://github.com/lvgl/lvgl.git
synced 2026-05-26 11:07:34 +08:00
fix(display): fix divide by stride of zero value (#8308)
Signed-off-by: zhouxingjian <zhouxingjian@xiaomi.com>
This commit is contained in:
@@ -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");
|
||||
|
||||
Reference in New Issue
Block a user