[Bf-blender-cvs] [7efdee7] master: Fix crash adding byte color grid images

Sergey Sharybin noreply at git.blender.org
Thu May 5 22:05:21 CEST 2016


Commit: 7efdee75177eb43909e825499330c554d91853f1
Author: Sergey Sharybin
Date:   Thu May 5 22:04:31 2016 +0200
Branches: master
https://developer.blender.org/rB7efdee75177eb43909e825499330c554d91853f1

Fix crash adding byte color grid images

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

M	source/blender/blenkernel/intern/image_gen.c

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

diff --git a/source/blender/blenkernel/intern/image_gen.c b/source/blender/blenkernel/intern/image_gen.c
index 4cbf49e..650ccd4 100644
--- a/source/blender/blenkernel/intern/image_gen.c
+++ b/source/blender/blenkernel/intern/image_gen.c
@@ -362,14 +362,16 @@ void BKE_image_buf_fill_checker_color(unsigned char *rect, float *rect_float, in
 
 	checker_board_text(rect, rect_float, width, height, 128, 2);
 
-	/* TODO(sergey): Currently it's easier to fill in form buffer and
-	 * linearize it afterwards. This could be optimized with some smart
-	 * trickery around blending factors and such.
-	 */
-	IMB_buffer_float_from_float(rect_float, rect_float,
-	                            4,
-	                            IB_PROFILE_LINEAR_RGB, IB_PROFILE_SRGB,
-	                            true,
-	                            width, height,
-	                            width, width);
+	if (rect_float != NULL) {
+		/* TODO(sergey): Currently it's easier to fill in form buffer and
+		 * linearize it afterwards. This could be optimized with some smart
+		 * trickery around blending factors and such.
+		 */
+		IMB_buffer_float_from_float(rect_float, rect_float,
+		                            4,
+		                            IB_PROFILE_LINEAR_RGB, IB_PROFILE_SRGB,
+		                            true,
+		                            width, height,
+		                            width, width);
+	}
 }




More information about the Bf-blender-cvs mailing list