fix: promote dimensions to usize so cell_count doesn't overflow

This commit is contained in:
Qwerasd
2024-08-08 20:43:47 -04:00
parent bdbf5ad1c7
commit 740dce6e66

View File

@ -116,7 +116,7 @@ pub const Contents = struct {
) !void {
self.size = size;
const cell_count = size.columns * size.rows;
const cell_count = @as(usize, size.columns) * @as(usize, size.rows);
const bg_cells = try alloc.alloc(mtl_shaders.CellBg, cell_count);
errdefer alloc.free(bg_cells);