Skip to content

Commit

Permalink
fix(draw_rect): refactor to insure header is initialized (lvgl#7446)
Browse files Browse the repository at this point in the history
  • Loading branch information
pfvogel authored Dec 12, 2024
1 parent f284920 commit 915f9b8
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/draw/lv_draw_rect.c
Original file line number Diff line number Diff line change
Expand Up @@ -201,11 +201,12 @@ void lv_draw_rect(lv_layer_t * layer, const lv_draw_rect_dsc_t * dsc, const lv_a
if(src_type == LV_IMAGE_SRC_VARIABLE || src_type == LV_IMAGE_SRC_FILE) {
res = lv_image_decoder_get_info(dsc->bg_image_src, &header);
}
else if(src_type == LV_IMAGE_SRC_UNKNOWN) {
res = LV_RESULT_INVALID;
}
else {
lv_memzero(&header, sizeof(header));

if(src_type == LV_IMAGE_SRC_UNKNOWN) {
res = LV_RESULT_INVALID;
}
}

if(res == LV_RESULT_OK) {
Expand Down

0 comments on commit 915f9b8

Please sign in to comment.