diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2016-05-05 23:04:31 +0300 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2016-05-05 23:05:09 +0300 |
commit | 7efdee75177eb43909e825499330c554d91853f1 (patch) | |
tree | ef461608b80955c83721d6317a812f35af38d8ad /source/blender/blenkernel/intern/image_gen.c | |
parent | 7b7e7ac4c1a0ba0ca31a26bf3901ec184ae8930a (diff) |
Fix crash adding byte color grid images
Diffstat (limited to 'source/blender/blenkernel/intern/image_gen.c')
-rw-r--r-- | source/blender/blenkernel/intern/image_gen.c | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/source/blender/blenkernel/intern/image_gen.c b/source/blender/blenkernel/intern/image_gen.c index 4cbf49e38c2..650ccd456fe 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); + } } |