Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHans Goudey <h.goudey@me.com>2020-10-14 18:00:24 +0300
committerHans Goudey <h.goudey@me.com>2020-10-14 18:00:24 +0300
commit1cf8a4e5ea5dc1e791c1b242d7d2d032dd194c78 (patch)
tree2323bf9bffdd9b6e39a713e2565aeefda96eaf28 /source/blender/editors/space_buttons
parentfecb276ef7b337145190a090169fe736145799b8 (diff)
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.
Diffstat (limited to 'source/blender/editors/space_buttons')
-rw-r--r--source/blender/editors/space_buttons/buttons_context.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/source/blender/editors/space_buttons/buttons_context.c b/source/blender/editors/space_buttons/buttons_context.c
index 0b018d05058..dcf2e6e74fa 100644
--- a/source/blender/editors/space_buttons/buttons_context.c
+++ b/source/blender/editors/space_buttons/buttons_context.c
@@ -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);
}