Fix #108117: Crash in uv editor with hidden geometry #108130

Merged
Chris Blackbourn merged 2 commits from Chris_Blackbourn/blender:uv-fix-108117-2 into blender-v3.6-release 2023-05-22 23:23:31 +02:00

Add NULL pointer protection for pointers returned from #BM_uv_element_get

Affects most UV transform tools, smart-stitch, sculptuv etc.

Add NULL pointer protection for pointers returned from #BM_uv_element_get Affects most UV transform tools, smart-stitch, sculptuv etc.
Chris Blackbourn added 1 commit 2023-05-22 03:48:38 +02:00
d217ad846e Fix #108117: Crash in uv editor with hidden geometry
Add NULL pointer protection for pointers returned from #BM_uv_element_get

Affects most UV transform tools, smart-stitch, sculptuv etc.
Chris Blackbourn requested review from Campbell Barton 2023-05-22 03:48:50 +02:00

While this change is OK, I miss the wider context.

Surely this would have caused crashes long ago if the functions were returning NULL, what changed recently that caused the crash?

Also, it would be good to update the doc-string for BM_uv_element_get noting under which conditions it will return NULL, since the caller might not be checking for hidden faces (assume this only happens when use_select & respecthide are set).

While this change is OK, I miss the wider context. Surely this would have caused crashes long ago if the functions were returning NULL, what changed recently that caused the crash? Also, it would be good to update the doc-string for `BM_uv_element_get` noting under which conditions it will return NULL, since the caller might not be checking for hidden faces (assume this only happens when `use_select` & `respecthide` are set).
Chris Blackbourn added 1 commit 2023-05-22 07:04:35 +02:00
Author
Member

Will create a 'Squash' commit:

Fix #108117: Crash in uv editor with hidden geometry

Many "UV island" style operations internally use #UvElementMap, including:

  • Transform tools
  • Smart-Stitch
  • UV Pinch, UV Grab and UV Relax sculpt tools.

Normally, every UV in the mesh is included in the #UvElementMap.
However, with hidden geometry, only the visible geometry is included.
This change enforces stricter usage, reducing the chance of crashes in other areas.

Will create a 'Squash' commit: ================== Fix #108117: Crash in uv editor with hidden geometry Many "UV island" style operations internally use #UvElementMap, including: * Transform tools * Smart-Stitch * UV Pinch, UV Grab and UV Relax sculpt tools. Normally, every UV in the mesh is included in the #UvElementMap. However, with hidden geometry, only the visible geometry is included. This change enforces stricter usage, reducing the chance of crashes in other areas.
Campbell Barton approved these changes 2023-05-22 11:27:47 +02:00
Member

check from 58c54b5859 Might possibly be redundant then? (havent checked though)

Surely this would have caused crashes long ago if the functions were returning NULL, what changed recently that caused the crash?

For context: 8f543a73ab was the cause for that issue

check from 58c54b5859 Might possibly be redundant then? (havent checked though) > Surely this would have caused crashes long ago if the functions were returning NULL, what changed recently that caused the crash? For context: 8f543a73abc42843fb924fc6d849e3055e3ae011 was the cause for that issue
Author
Member

check from 58c54b5859 Might possibly be redundant then? (havent checked though)

Surely this would have caused crashes long ago if the functions were returning NULL, what changed recently that caused the crash?

For context: 8f543a73ab was the cause for that issue

I didn't fully sanitize the smart-stitch code as I don't have good test procedures for that area.
Best to keep both fixes...

> check from 58c54b5859 Might possibly be redundant then? (havent checked though) > > > Surely this would have caused crashes long ago if the functions were returning NULL, what changed recently that caused the crash? > > For context: 8f543a73abc42843fb924fc6d849e3055e3ae011 was the cause for that issue I didn't fully sanitize the smart-stitch code as I don't have good test procedures for that area. Best to keep both fixes...

In this case, it's worth mentioning the crash is a regression caused by 8f543a73ab (fix for T99659).

In this case, it's worth mentioning the crash is a regression caused by 8f543a73abc42843fb924fc6d849e3055e3ae011 (fix for T99659).
Chris Blackbourn merged commit ae9ac99d2b into blender-v3.6-release 2023-05-22 23:23:30 +02:00
Chris Blackbourn deleted branch uv-fix-108117-2 2023-05-22 23:23:33 +02:00
Howard Trickey referenced this issue from a commit 2023-05-29 02:51:38 +02:00
Sign in to join this conversation.
No reviewers
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset Browser
Interest
Asset Browser Project Overview
Interest
Audio
Interest
Automated Testing
Interest
Blender Asset Bundle
Interest
BlendFile
Interest
Collada
Interest
Compatibility
Interest
Compositing
Interest
Core
Interest
Cycles
Interest
Dependency Graph
Interest
Development Management
Interest
EEVEE
Interest
EEVEE & Viewport
Interest
Freestyle
Interest
Geometry Nodes
Interest
Grease Pencil
Interest
ID Management
Interest
Images & Movies
Interest
Import Export
Interest
Line Art
Interest
Masking
Interest
Metal
Interest
Modeling
Interest
Modifiers
Interest
Motion Tracking
Interest
Nodes & Physics
Interest
OpenGL
Interest
Overlay
Interest
Overrides
Interest
Performance
Interest
Physics
Interest
Pipeline, Assets & IO
Interest
Platforms, Builds & Tests
Interest
Python API
Interest
Render & Cycles
Interest
Render Pipeline
Interest
Sculpt, Paint & Texture
Interest
Text Editor
Interest
Translations
Interest
Triaging
Interest
Undo
Interest
USD
Interest
User Interface
Interest
UV Editing
Interest
VFX & Video
Interest
Video Sequencer
Interest
Virtual Reality
Interest
Vulkan
Interest
Wayland
Interest
Workbench
Interest: X11
Legacy
Blender 2.8 Project
Legacy
Milestone 1: Basic, Local Asset Browser
Legacy
OpenGL Error
Meta
Good First Issue
Meta
Papercut
Meta
Retrospective
Meta
Security
Module
Animation & Rigging
Module
Core
Module
Development Management
Module
EEVEE & Viewport
Module
Grease Pencil
Module
Modeling
Module
Nodes & Physics
Module
Pipeline, Assets & IO
Module
Platforms, Builds & Tests
Module
Python API
Module
Render & Cycles
Module
Sculpt, Paint & Texture
Module
Triaging
Module
User Interface
Module
VFX & Video
Platform
FreeBSD
Platform
Linux
Platform
macOS
Platform
Windows
Priority
High
Priority
Low
Priority
Normal
Priority
Unbreak Now!
Status
Archived
Status
Confirmed
Status
Duplicate
Status
Needs Info from Developers
Status
Needs Information from User
Status
Needs Triage
Status
Resolved
Type
Bug
Type
Design
Type
Known Issue
Type
Patch
Type
Report
Type
To Do
No Milestone
No project
No Assignees
3 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: blender/blender#108130
No description provided.