Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(vg_lite):check the color format before alloc layer buffer #6071

Merged
merged 1 commit into from
Apr 17, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
fix(draw):Before allocating draw buffer, first determine whether the …
…target format is supported

Signed-off-by: bailinjiang <[email protected]>
  • Loading branch information
jiangxiaobaiyuenyxx committed Apr 15, 2024
commit 7f44459a9425b6d56a065ba50576dcb3454f4505
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
Loading