Skip to content

Commit

Permalink
Fix CodeQL error
Browse files Browse the repository at this point in the history
Multiplication result converted to larger type
  • Loading branch information
sh1r4s3 committed Sep 15, 2024
1 parent 24ccc7e commit 8fed6a8
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions i3lock.c
Original file line number Diff line number Diff line change
Expand Up @@ -1241,16 +1241,16 @@ static cairo_surface_t *read_gif_image(const char *image_path) {
switch (gc.DisposalMode) {
case DISPOSE_DO_NOT:
if (data_prev) {
memcpy(data, data_prev, width*height*sizeof(uint32_t));
memcpy(data, data_prev, data_size);
} else {
memset(data, 0, width*height*sizeof(uint32_t));
memset(data, 0, data_size);
}
break;
case DISPOSE_BACKGROUND:
memset(data, bg_color, width*height*sizeof(uint32_t));
memset(data, bg_color, data_size);
break;
default:
memset(data, 0, width*height*sizeof(uint32_t));
memset(data, 0, data_size);
}

/* Read RGB */
Expand Down

0 comments on commit 8fed6a8

Please sign in to comment.