diff options
author | RĂ©mi Verschelde <rverschelde@gmail.com> | 2020-05-15 18:05:53 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-05-15 18:05:53 +0200 |
commit | f06c44a02c2b643034babb8b90c89a4a22d0c62e (patch) | |
tree | 6c2b9d0a3fe3b0927898412978b210acc4b5f22f | |
parent | bc008d413e650c4ecd00b399e404bb35b51ad253 (diff) | |
parent | 6c4c1bf53d9796c5f2cf7a9b430b32202c8f69f6 (diff) |
Merge pull request #38717 from madmiraal/fix-image-uninitialized-warning
Silence 'w' may be used uninitialized in image.cpp warning.
-rw-r--r-- | core/image.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/core/image.cpp b/core/image.cpp index 29be2ff5eb..f99e8a636f 100644 --- a/core/image.cpp +++ b/core/image.cpp @@ -1993,7 +1993,7 @@ void Image::create(const char **p_xpm) { HashMap<String, Color> colormap; int colormap_size = 0; uint32_t pixel_size = 0; - uint8_t *w; + uint8_t *data_write = nullptr; while (status != DONE) { const char *line_ptr = p_xpm[line]; @@ -2089,7 +2089,7 @@ void Image::create(const char **p_xpm) { if (line == colormap_size) { status = READING_PIXELS; create(size_width, size_height, false, has_alpha ? FORMAT_RGBA8 : FORMAT_RGB8); - w = data.ptrw(); + data_write = data.ptrw(); pixel_size = has_alpha ? 4 : 3; } } break; @@ -2107,7 +2107,7 @@ void Image::create(const char **p_xpm) { for (uint32_t i = 0; i < pixel_size; i++) { pixel[i] = CLAMP((*colorptr)[i] * 255, 0, 255); } - _put_pixelb(x, y, pixel_size, w, pixel); + _put_pixelb(x, y, pixel_size, data_write, pixel); } if (y == (size_height - 1)) { |