[Bf-blender-cvs] [3f5e0f7d91e] master: Fix crash sampling render result before any pixel was rendered

Sergey Sharybin noreply at git.blender.org
Fri Aug 27 15:07:55 CEST 2021


Commit: 3f5e0f7d91e0e13870d98fe721a871e6be210489
Author: Sergey Sharybin
Date:   Fri Aug 27 15:07:26 2021 +0200
Branches: master
https://developer.blender.org/rB3f5e0f7d91e0e13870d98fe721a871e6be210489

Fix crash sampling render result before any pixel was rendered

Caused by recent lazy render result passes allocation change.

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

M	source/blender/editors/space_image/image_draw.c

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

diff --git a/source/blender/editors/space_image/image_draw.c b/source/blender/editors/space_image/image_draw.c
index 4f66506d28b..d2af26aa1d7 100644
--- a/source/blender/editors/space_image/image_draw.c
+++ b/source/blender/editors/space_image/image_draw.c
@@ -389,10 +389,12 @@ void ED_image_draw_info(Scene *scene,
     immRecti(pos, color_quater_x, color_quater_y, color_rect_half.xmax, color_rect_half.ymax);
     immRecti(pos, color_rect_half.xmin, color_rect_half.ymin, color_quater_x, color_quater_y);
 
-    GPU_blend(GPU_BLEND_ALPHA);
-    immUniformColor3fvAlpha(finalcol, fp ? fp[3] : (cp[3] / 255.0f));
-    immRecti(pos, color_rect.xmin, color_rect.ymin, color_rect.xmax, color_rect.ymax);
-    GPU_blend(GPU_BLEND_NONE);
+    if (fp != NULL || cp != NULL) {
+      GPU_blend(GPU_BLEND_ALPHA);
+      immUniformColor3fvAlpha(finalcol, fp ? fp[3] : (cp[3] / 255.0f));
+      immRecti(pos, color_rect.xmin, color_rect.ymin, color_rect.xmax, color_rect.ymax);
+      GPU_blend(GPU_BLEND_NONE);
+    }
   }
   else {
     immUniformColor3fv(finalcol);



More information about the Bf-blender-cvs mailing list