Skip to content

Commit

Permalink
Merge pull request #370 from evo-lua/325-fix-stbi-warning
Browse files Browse the repository at this point in the history
Fix a CodeQL warning in the stbi FFI bindings
  • Loading branch information
Duckwhale committed Dec 12, 2023
2 parents 904d1c9 + 522d6d1 commit 808e307
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Runtime/Bindings/stbi_ffi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ void stbi_abgr_to_rgba(stbi_image_t* image) {
if(!image) return;
if(!image->data) return;

const size_t num_pixels = image->width * image->height;
const size_t num_pixels = static_cast<size_t>(image->width) * static_cast<size_t>(image->height);
for(size_t i = 0; i < num_pixels; i++) {
uint8_t* pixel = image->data + i * 4;
std::swap(pixel[ABGR_ALPHA_INDEX], pixel[ABGR_RED_INDEX]);
Expand Down

0 comments on commit 808e307

Please sign in to comment.