Skip to content

Commit

Permalink
fix(vg_lite):check the color format before alloc layer buffer (lvgl#6071
Browse files Browse the repository at this point in the history
)

Signed-off-by: bailinjiang <[email protected]>
  • Loading branch information
jiangxiaobaiyuenyxx committed Apr 17, 2024
1 parent d1306d3 commit 516825f
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/draw/vg_lite/lv_draw_vg_lite.c
Original file line number Diff line number Diff line change
Expand Up @@ -173,13 173,13 @@ static int32_t draw_dispatch(lv_draw_unit_t * draw_unit, lv_layer_t * layer)
return -1;
}

void * buf = lv_draw_layer_alloc_buf(layer);
if(!buf) {
/* Return if target buffer format is not supported. */
if(!lv_vg_lite_is_dest_cf_supported(layer->color_format)) {
return -1;
}

/* Return if target buffer format is not supported. */
if(!lv_vg_lite_is_dest_cf_supported(layer->draw_buf->header.cf)) {
void * buf = lv_draw_layer_alloc_buf(layer);
if(!buf) {
return -1;
}

Expand Down

0 comments on commit 516825f

Please sign in to comment.