Fix #114152: Blender crashes when loading files with unknown IDProperty types.

Issue was reported with a 3.6 file crashing 3.3LTS, but the underlying
problem still exists in current codebase, and could also potentially be
caused by other edge-cases.

Pull Request: https://projects.blender.org/blender/blender/pulls/114397
This commit is contained in:
Bastien Montagne
2023-11-02 11:17:20 +01:00
committed by Gitea
parent d4262071b1
commit 67445c2353
@@ -1307,6 +1307,10 @@ static void IDP_DirectLinkProperty(IDProperty *prop, BlendDataReader *reader);
static void read_ui_data(IDProperty *prop, BlendDataReader *reader) static void read_ui_data(IDProperty *prop, BlendDataReader *reader)
{ {
BLO_read_data_address(reader, &prop->ui_data); BLO_read_data_address(reader, &prop->ui_data);
if (!prop->ui_data) {
/* Can happen when opening more recent files with unknown tyes of IDProperties. */
return;
}
BLO_read_data_address(reader, &prop->ui_data->description); BLO_read_data_address(reader, &prop->ui_data->description);
switch (IDP_ui_data_type(prop)) { switch (IDP_ui_data_type(prop)) {