Page MenuHome

Fix T93431: Crash when empty is marked as asset
ClosedPublic

Authored by Pratik Borhade (PratikPB2123) on Nov 28 2021, 11:30 AM.

Details

Summary

Fix T93431.
Crash was introduced in 481f032f5cbe2cd3c36c9ef516670fd9e06db25f

make ED_preview_id_is_supported function NULL-safe

Diff Detail

Repository
rB Blender

Event Timeline

Sybren A. Stüvel (sybren) requested changes to this revision.Nov 29 2021, 11:45 AM
Sybren A. Stüvel (sybren) added inline comments.
source/blender/editors/interface/interface_icons.c
2048

It would be better to have ED_preview_id_is_supported NULL-safe. You can just add

if (id == NULL) {
  return false;
}

to the function. Semantically it makes sense as well, as NULL cannot have a preview.

This revision now requires changes to proceed.Nov 29 2021, 11:45 AM

make ED_preview_id_is_supported function NULL-safe

Adding @Jeroen Bakker (jbakker) as blocking reviewer as he's available to do the review (@Julian Eisel (Severin) is not, today).

Jeroen Bakker (jbakker) requested changes to this revision.Nov 29 2021, 2:27 PM

Would add the check to UI_icon_render_id as it is the only user and seems like there it also reads from uninitialized memory.
Add an pre-check assert in ED_preview_id_is_supported.

This revision now requires changes to proceed.Nov 29 2021, 2:27 PM

Sorry, my previous review was incorrect. Code is good.

This revision is now accepted and ready to land.Nov 29 2021, 3:14 PM

Thanks everyone for the review :)