Page MenuHome

Fix uninitialized ColorSceneLinear4f occuring in certain situations.
ClosedPublic

Authored by Martijn Versteegh (Baardaap) on Dec 23 2022, 12:14 PM.

Details

Summary

On gcc 11.3, Ubuntu 22.04 the default constructor for ColorSceneLinear4f did not zero the r,g,b,a member variables. Replacing the empty constructor with a default constructor circumvents this problem (compiler bug? ) even though it *should* be more or less equivalent.

Diff Detail

Repository
rB Blender

Event Timeline

I'm glad a simple solution like this was possible in the end. If we have Array<ColorGeometry4f> colors(size);, the array is still not initialized by default, right?

I'm not really sure. I think it would be initialized. But at least it now behaves the same on all platforms.

now Array<ColorSceneLinear4f> behaves the same as Array<ColorRGBA> , whereas previously they were different.

I'll test.

I tested it and the Array<ColorScene4f> situation is indeed not initialized by default.

Then I think this is a fine solution. It's consistent with similar code elsewhere too. Thanks.

This revision is now accepted and ready to land.Dec 24 2022, 12:33 AM

I pushed the change and closed this diff, I hope I did everything correctly?

You can also add a link to the patch in the commit