fix(draw_rect): refactor to insure header is initialized (#7446)

This commit is contained in:
Paul Vogel
2024-12-12 05:10:24 -06:00
committed by GitHub
parent f284920b93
commit 915f9b88dc

View File

@@ -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) {