Fix T74925: Texture Paint Stencil Mask crash

Use first texture if we dont have an ImageUser.

Maniphest Tasks: T74925

Differential Revision: https://developer.blender.org/D7181
This commit is contained in:
Philipp Oeser 2020-03-19 12:47:06 +01:00
parent 42012493a8
commit 9ace7e2439
Notes: blender-bot 2023-02-14 06:21:59 +01:00
Referenced by commit 266caa1820, Fix T76755: texture paint on udims crash
Referenced by issue #76757, texture paint crash
Referenced by issue #75086, Texture Painting Image Import Crashes.
Referenced by issue #74925, Texture Paint Stencil Mask crash
1 changed files with 1 additions and 1 deletions

View File

@ -877,7 +877,7 @@ GPUTexture *GPU_texture_from_blender(Image *ima, ImageUser *iuser, ImBuf *ibuf,
BKE_image_tag_time(ima);
/* Test if we already have a texture. */
GPUTexture **tex = gpu_get_image_gputexture(ima, textarget, iuser->multiview_eye);
GPUTexture **tex = gpu_get_image_gputexture(ima, textarget, iuser ? iuser->multiview_eye : 0);
if (*tex) {
return *tex;
}