diff --git a/src/textures/texture.cpp b/src/textures/texture.cpp index 997ac3708..50ba4d1bd 100644 --- a/src/textures/texture.cpp +++ b/src/textures/texture.cpp @@ -1136,10 +1136,10 @@ void FTexture::GetGlowColor(float *data) if (bGlowing && GlowColor == 0) { int w = Width, h = Height; - auto buffer = new uint8_t[w * h]; + auto buffer = new uint8_t[w * h * 4]; if (buffer) { - FillBuffer(buffer, w, h, TEX_RGB); + FillBuffer(buffer, w * 4, h, TEX_RGB); GlowColor = averageColor((uint32_t *)buffer, w*h, 153); delete[] buffer; }