We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent d8df2b0 commit 9ade91eCopy full SHA for 9ade91e
1 file changed
src/kloak.c
@@ -475,7 +475,8 @@ static int64_t current_time_ms(void) {
475
int64_t result = 0;
476
477
clock_gettime(CLOCK_MONOTONIC, &spec);
478
- result = (spec.tv_sec * 1000) + (spec.tv_nsec / 1000000);
+ assert(spec.tv_sec < INT64_MAX);
479
+ result = ((int64_t)spec.tv_sec * 1000) + (spec.tv_nsec / 1000000);
480
assert(result >= 0);
481
if (start_time == 0) {
482
start_time = result;
@@ -1527,7 +1528,7 @@ static void layer_surface_configure(void *data,
1527
1528
}
1529
1530
assert(layer != NULL);
- assert(width * 4 <= INT32_MAX);
1531
+ assert(width <= INT32_MAX / 4);
1532
assert(height <= INT32_MAX);
1533
layer->width = (int32_t)(width);
1534
layer->height = (int32_t)(height);
0 commit comments