diff options
author | Jeroen Bakker <jeroen@blender.org> | 2021-10-25 12:40:49 +0300 |
---|---|---|
committer | Jeroen Bakker <jeroen@blender.org> | 2021-10-25 12:41:49 +0300 |
commit | 8e56f3e8a36d76ad1765f939c018a5ec3c01faab (patch) | |
tree | 6097a17b03b8619abd028fd9b5701033f798ce34 /source | |
parent | b3ca926aa8e1a2ea26dc5145cd361c211d786c63 (diff) |
Image: Fix Crash During Undo.
Fixes T91294.
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/blenkernel/intern/image.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/source/blender/blenkernel/intern/image.c b/source/blender/blenkernel/intern/image.c index 5ae338aaaeb..3800cbec94b 100644 --- a/source/blender/blenkernel/intern/image.c +++ b/source/blender/blenkernel/intern/image.c @@ -211,8 +211,12 @@ static void image_foreach_cache(ID *id, for (int eye = 0; eye < 2; eye++) { for (int a = 0; a < TEXTARGET_COUNT; a++) { for (int resolution = 0; resolution < IMA_TEXTURE_RESOLUTION_LEN; resolution++) { + GPUTexture *texture = image->gputexture[a][eye][resolution]; + if (texture == NULL) { + continue; + } key.offset_in_ID = offsetof(Image, gputexture[a][eye][resolution]); - key.cache_v = image->gputexture[a][eye]; + key.cache_v = texture; function_callback(id, &key, (void **)&image->gputexture[a][eye][resolution], 0, user_data); } } |