[Bf-blender-cvs] [ab18dbb67e0] master: Fix potential crash with Eevee render of missing image textures

Brecht Van Lommel noreply at git.blender.org
Sat Feb 15 20:33:05 CET 2020


Commit: ab18dbb67e059ce1505189a14739e1e4deffacc1
Author: Brecht Van Lommel
Date:   Sat Feb 15 18:53:08 2020 +0100
Branches: master
https://developer.blender.org/rBab18dbb67e059ce1505189a14739e1e4deffacc1

Fix potential crash with Eevee render of missing image textures

This NULL check is needed elsewhere, do it here as well.

===================================================================

M	source/blender/gpu/intern/gpu_draw.c

===================================================================

diff --git a/source/blender/gpu/intern/gpu_draw.c b/source/blender/gpu/intern/gpu_draw.c
index cac3ba37b0a..6afff4f68f1 100644
--- a/source/blender/gpu/intern/gpu_draw.c
+++ b/source/blender/gpu/intern/gpu_draw.c
@@ -880,7 +880,7 @@ GPUTexture *GPU_texture_from_blender(Image *ima, ImageUser *iuser, ImBuf *ibuf,
    * texture with zero bindcode so we don't keep trying. */
   uint bindcode = 0;
   ImageTile *tile = BKE_image_get_tile(ima, 0);
-  if (tile->ok == 0) {
+  if (tile == NULL || tile->ok == 0) {
     *tex = GPU_texture_from_bindcode(textarget, bindcode);
     return *tex;
   }



More information about the Bf-blender-cvs mailing list