Page MenuHome

Fix T86073 : Ctrl clicking 3 times without selecting any of the verts in NurbsPath leads crash.
AbandonedPublic

Authored by Pratik Borhade (PratikPB2123) on Mar 22 2021, 11:05 AM.

Details

Summary

Fix T86073 .

crash occurs at assert(builder->index_len < builder->max_index_len)

  • check added to fix the crash .

Diff Detail

Repository
rB Blender

Event Timeline

Pratik Borhade (PratikPB2123) requested review of this revision.Mar 22 2021, 11:05 AM
Pratik Borhade (PratikPB2123) created this revision.
source/blender/draw/intern/draw_cache_impl_curve.c
784 ↗(On Diff #35465)

I understand that the problem is with the operator, so why change this part?
Although this change is harmless (since verts_len_capacity is always greater than edges_len_capacity), it does not seem to be correct.

@Germano Cavalcante (mano-wii) , Guess no need of change in draw_cache_impl_curve . I was investigating reason of crash and found edges_len_capacity was carrying inaccurate value ( before looking into operator's code ) .
On adding check in operator's code . I guess draw_cache_impl_curve needs to be reverted .

Updating the patch .

Pratik Borhade (PratikPB2123) edited the summary of this revision. (Show Details)
  • Changes reverted from draw_cache_impl_curve.c
Germano Cavalcante (mano-wii) requested changes to this revision.Mar 23 2021, 2:54 PM
Germano Cavalcante (mano-wii) added inline comments.
source/blender/editors/curve/editcurve.c
5497

The previous condition is if (!nu || nu->type == CU_BEZIER) { so, as here is form an else, the nu can never be NULL, so this code is unreachable.

This revision now requires changes to proceed.Mar 23 2021, 2:54 PM
  • check updated to if (nu && nu->type == CU_NURBS)

Thanks for the patch.
Investigating the code, I realized that the code could be improved in other ways (deduplicating, commenting).
So I committed a similar solution -> rB9e206039d4f6: Fix T86073 : Ctrl clicking 3 times without selecting any of the verts in…