diff options
author | turjuque <turjuque@gmail.com> | 2016-06-16 02:46:36 +0300 |
---|---|---|
committer | turjuque <turjuque@gmail.com> | 2016-06-16 02:46:36 +0300 |
commit | 22c83011a961cb5302f8a8f8b013772b32b8543a (patch) | |
tree | 921f58dbe833d09ad941e21b23993702b92d3c6a /source | |
parent | d2ec40b8f5b4b108fb9457cc521470a42c426f7c (diff) |
Fix Crash.
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/nodes/shader/nodes/node_shader_tex_image.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/source/blender/nodes/shader/nodes/node_shader_tex_image.c b/source/blender/nodes/shader/nodes/node_shader_tex_image.c index e023a73b0e1..d04dad484e9 100644 --- a/source/blender/nodes/shader/nodes/node_shader_tex_image.c +++ b/source/blender/nodes/shader/nodes/node_shader_tex_image.c @@ -104,7 +104,11 @@ static int node_shader_gpu_tex_image(GPUMaterial *mat, bNode *node, bNodeExecDat else { if (tex->interpolation == SHD_INTERP_CLOSEST) { ImBuf *ibuf = BKE_image_acquire_ibuf(ima, iuser, NULL); - float dim[2] = {ibuf->x, ibuf->y}; + + if (!ibuf) + return GPU_stack_link(mat, "node_tex_image_empty", in, out); + + float dim[2] = {(float)ibuf->x, (float)ibuf->y}; GPU_stack_link(mat, "node_tex_image_closest", in, out, GPU_image(ima, iuser, isdata, do_clip), GPU_uniform(dim)); BKE_image_release_ibuf(ima, ibuf, NULL); } |