Skip to content

Commit

Permalink
fix(animimage): preventing array subscripting of NULL values
Browse files Browse the repository at this point in the history
  • Loading branch information
yinntian committed May 9, 2024
1 parent 2afbfc4 commit 7f9a316
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/widgets/animimage/lv_animimage.c
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,11 @@ static void index_change(lv_obj_t * obj, int32_t index)
int32_t idx;
lv_animimg_t * animimg = (lv_animimg_t *)obj;

if(animimg->dsc == NULL) {
LV_LOG_ERROR("dsc is null");
return;
}

idx = index % animimg->pic_count;

lv_image_set_src(obj, animimg->dsc[idx]);
Expand Down

0 comments on commit 7f9a316

Please sign in to comment.