From 5b816ab8f8172bafe9ef5432904a9762e3d4740f Mon Sep 17 00:00:00 2001 From: Ton Roosendaal Date: Thu, 15 Feb 2007 10:46:10 +0000 Subject: Bugfix (via email) Bake crashed when baking to float images. Caused by an Imbuf call not handling float imbufs well. --- source/blender/imbuf/intern/rectop.c | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) (limited to 'source/blender/imbuf') diff --git a/source/blender/imbuf/intern/rectop.c b/source/blender/imbuf/intern/rectop.c index bf459524c80..85c5e07bb8e 100644 --- a/source/blender/imbuf/intern/rectop.c +++ b/source/blender/imbuf/intern/rectop.c @@ -489,18 +489,21 @@ void IMB_rectblend_torus(struct ImBuf *dbuf, struct ImBuf *sbuf, int destx, void IMB_rectfill(struct ImBuf *drect, float col[4]) { int num; - unsigned int *rrect = drect->rect; - char ccol[4]; - - ccol[0]= (int)(col[0]*255); - ccol[1]= (int)(col[1]*255); - ccol[2]= (int)(col[2]*255); - ccol[3]= (int)(col[3]*255); - - num = drect->x * drect->y; - for (;num > 0; num--) - *rrect++ = *((unsigned int*)ccol); + if(drect->rect) { + unsigned int *rrect = drect->rect; + char ccol[4]; + + ccol[0]= (int)(col[0]*255); + ccol[1]= (int)(col[1]*255); + ccol[2]= (int)(col[2]*255); + ccol[3]= (int)(col[3]*255); + + num = drect->x * drect->y; + for (;num > 0; num--) + *rrect++ = *((unsigned int*)ccol); + } + if(drect->rect_float) { float *rrectf = drect->rect_float; -- cgit v1.2.3