diff options
author | Ton Roosendaal <ton@blender.org> | 2007-02-15 13:46:10 +0300 |
---|---|---|
committer | Ton Roosendaal <ton@blender.org> | 2007-02-15 13:46:10 +0300 |
commit | 5b816ab8f8172bafe9ef5432904a9762e3d4740f (patch) | |
tree | 8396a46df23d072305e5f04a6cf8495cd754f911 /source/blender/imbuf/intern/rectop.c | |
parent | 97cc5db444c26f8a3054259d74337894642c6ff3 (diff) |
Bugfix (via email)
Bake crashed when baking to float images. Caused by an Imbuf call not
handling float imbufs well.
Diffstat (limited to 'source/blender/imbuf/intern/rectop.c')
-rw-r--r-- | source/blender/imbuf/intern/rectop.c | 25 |
1 files changed, 14 insertions, 11 deletions
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; |