Fix Asan warning in property editor texture tab
When there is no active texture, a NULL pointer was dereferenced. It didn't crash because the dereference was for the first item at the pointer, the ID. To fix this, return with no data when `texture is NULL.
This commit is contained in:
@@ -880,6 +880,10 @@ int /*eContextResult*/ buttons_context(const bContext *C,
|
||||
ButsContextTexture *ct = sbuts->texuser;
|
||||
|
||||
if (ct) {
|
||||
if (ct->texture == NULL) {
|
||||
return CTX_RESULT_NO_DATA;
|
||||
}
|
||||
|
||||
CTX_data_pointer_set(result, &ct->texture->id, &RNA_Texture, ct->texture);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user