Image: Fix Crash During Undo.

Fixes T91294.
This commit is contained in:
Jeroen Bakker 2021-10-25 11:40:49 +02:00
parent b3ca926aa8
commit 8e56f3e8a3
Notes: blender-bot 2023-02-14 08:28:46 +01:00
Referenced by issue #91294, Draw: Crash on undo after adding new texture
1 changed files with 5 additions and 1 deletions

View File

@ -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);
}
}