Skip to content
This repository has been archived by the owner on May 31, 2024. It is now read-only.

Commit

Permalink
fix to array indexing error
Browse files Browse the repository at this point in the history
  • Loading branch information
danilw authored Oct 5, 2022
1 parent bb3fbf7 commit d1efe73
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/nanovg_vk.h
Original file line number Diff line number Diff line change
Expand Up @@ -1448,7 +1448,7 @@ static int vknvg_renderCreateTexture(void *uptr, int type, int w, int h, int ima
uint8_t *generated_texture = (uint8_t*)malloc(texture_size);
for (uint32_t i = 0; i < (uint32_t) w; ++i){
for (uint32_t j = 0; j < (uint32_t) h; ++j){
size_t pixel = (i * w + j) * tx_format * sizeof(uint8_t);
size_t pixel = (i + j * w) * tx_format * sizeof(uint8_t);
if (type == NVG_TEXTURE_RGBA) {
generated_texture[pixel + 0] = 0x00;
generated_texture[pixel + 1] = 0x00;
Expand Down

0 comments on commit d1efe73

Please sign in to comment.