Skip to content

Commit

Permalink
vsimage.cpp: Address one more code scanning alert
Browse files Browse the repository at this point in the history
  • Loading branch information
stephengtuggy committed Feb 15, 2025
1 parent 92727ad commit bca118e
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion engine/src/gfx/vsimage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<uintmax_t>(this->img_depth) / 8ULL)
* (static_cast<uintmax_t>(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) {
Expand Down

0 comments on commit bca118e

Please sign in to comment.