From bca118e30bb4d4ab5c747e1d68ab59708c6c9c7f Mon Sep 17 00:00:00 2001 From: "Stephen G. Tuggy" Date: Fri, 14 Feb 2025 17:12:33 -0800 Subject: [PATCH] vsimage.cpp: Address one more code scanning alert --- engine/src/gfx/vsimage.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/engine/src/gfx/vsimage.cpp b/engine/src/gfx/vsimage.cpp index 43f9c9863..73ef8a5a2 100644 --- a/engine/src/gfx/vsimage.cpp +++ b/engine/src/gfx/vsimage.cpp @@ -959,7 +959,8 @@ VSError VSImage::WritePNG(unsigned char *data) { png_set_swap(png_ptr); } #endif - intmax_t stride = (this->img_depth / 8) * (this->img_alpha ? 4 : 3); + const uintmax_t stride = (static_cast(this->img_depth) / 8ULL) + * (static_cast(this->img_alpha) ? 4ULL : 3ULL); png_byte **row_pointers = new png_byte *[this->sizeY]; if (this->flip) { for (intmax_t i = this->sizeY - 1, j = 0; i >= 0; i--, ++j) {