Skip to content

Commit 035c5b7

Browse files
authored
Fixed wrong stack allocation (cyberbotics#6928)
* Fixed wrong stack allocation * Simplified
1 parent 141a670 commit 035c5b7

1 file changed

Lines changed: 2 additions & 3 deletions

File tree

src/webots/nodes/WbBackground.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -638,12 +638,11 @@ void WbBackground::applySkyBoxToWren() {
638638
} else { // otherwise, use a small uniform texture with the color of the sky
639639
cm = wr_texture_cubemap_new();
640640
size = 2;
641-
const int size2 = size * size;
642641
wr_texture_set_internal_format(WR_TEXTURE(cm), WR_TEXTURE_INTERNAL_FORMAT_RGBA8);
643-
unsigned int data[size2];
642+
unsigned int data[4];
644643
const WbRgb &c = skyColor();
645644
unsigned int color = c.redByte() * 0x10000 + c.greenByte() * 0x100 + c.blueByte();
646-
for (int i = 0; i < size2; i++)
645+
for (int i = 0; i < 4; i++)
647646
data[i] = color;
648647
for (int i = 0; i < 6; i++)
649648
wr_texture_cubemap_set_data(cm, reinterpret_cast<const char *>(data), static_cast<WrTextureOrientation>(i));

0 commit comments

Comments
 (0)