Page MenuHome

T80899: Crash on editing multiple UVs of multiple different objects at the same time
ClosedPublic

Authored by Sebastian Parborg (zeddb) on Sep 21 2020, 11:58 AM.

Details

Summary

The issue was two fold.

First something sets the loop element tag and doesn't clear it before the UV code in question tries to use the tags.
Added a sanity clear to make sure that it operates on a clean tag state.

The next one was that the UV maps in question had quite a few points that had zero length UV loop edges.
This would lead to division by zero.

Diff Detail

Repository
rB Blender

Event Timeline

source/blender/editors/uvedit/uvedit_select.c
705 ↗(On Diff #29118)

Why don't we change closest_to_line_v2 to be more like closest_to_line_v2_db you would assume that those functions would work the same. Currently there are a lot of places that has many potential errors.

Sebastian Parborg (zeddb) added inline comments.
source/blender/editors/uvedit/uvedit_select.c
705 ↗(On Diff #29118)

I agree that it would perhaps be better to add sanity checks in the float version as well.

@Brecht Van Lommel (brecht) is it fine if I add the same kind of check in the float version for 2.90.1?

source/blender/editors/uvedit/uvedit_select.c
705 ↗(On Diff #29118)

I think it's fine to add a sanity check to closest_to_line_v2, but I think the one in closest_to_line_v2_db is wrong.

I would check if the denominator == 0.0f, since < FLT_EPSILON may skip some valid cases. That's also a safer change.

Sebastian Parborg (zeddb) updated this revision to Diff 29128.EditedSep 21 2020, 2:36 PM
Sebastian Parborg (zeddb) marked 2 inline comments as done.

Updated the double version as well with the feedback from Brecht, it was not used anywhere currently in the code, so that should be a safe change.

This revision is now accepted and ready to land.Sep 21 2020, 3:36 PM