Skip to content

Commit

Permalink
fix(fragment): catch wrong instance_size (#4442)
Browse files Browse the repository at this point in the history
Signed-off-by: pengyiqiang <pengyiqiang@xiaomi.com>
Co-authored-by: pengyiqiang <pengyiqiang@xiaomi.com>
  • Loading branch information
FASTSHIFT and pengyiqiang committed Aug 10, 2023
1 parent 76d4e56 commit afa28a1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/others/fragment/lv_fragment.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ lv_fragment_t * lv_fragment_create(const lv_fragment_class_t * cls, void * args)
{
LV_ASSERT_NULL(cls);
LV_ASSERT_NULL(cls->create_obj_cb);
LV_ASSERT(cls->instance_size > 0);
LV_ASSERT(cls->instance_size >= sizeof(lv_fragment_t));
lv_fragment_t * instance = lv_malloc(cls->instance_size);
lv_memzero(instance, cls->instance_size);
instance->cls = cls;
Expand Down

0 comments on commit afa28a1

Please sign in to comment.