Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrecht Van Lommel <brechtvanlommel@pandora.be>2010-04-01 18:32:08 +0400
committerBrecht Van Lommel <brechtvanlommel@pandora.be>2010-04-01 18:32:08 +0400
commit7e776137ed962336aa7f5ae695a8df5923a5f71d (patch)
tree6857c7d7080ccc7994f92d4119782fe4972d3535 /source/blender
parentdf827a64006b76c445bb170ee263dc0f9188dfa9 (diff)
Fix #21771: crash in render baking with image that can't be loaded.
Diffstat (limited to 'source/blender')
-rw-r--r--source/blender/render/intern/source/rendercore.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/source/blender/render/intern/source/rendercore.c b/source/blender/render/intern/source/rendercore.c
index d9521bc892f..fbb390cdc03 100644
--- a/source/blender/render/intern/source/rendercore.c
+++ b/source/blender/render/intern/source/rendercore.c
@@ -2636,10 +2636,11 @@ int RE_bake_shade_all_selected(Render *re, int type, Object *actob, short *do_up
for(ima= G.main->image.first; ima; ima= ima->id.next) {
ImBuf *ibuf= BKE_image_get_ibuf(ima, NULL);
ima->id.flag |= LIB_DOIT;
- if (ibuf)
+ if(ibuf) {
ibuf->userdata = NULL; /* use for masking if needed */
- if(ibuf->rect_float)
- ibuf->profile = IB_PROFILE_LINEAR_RGB;
+ if(ibuf->rect_float)
+ ibuf->profile = IB_PROFILE_LINEAR_RGB;
+ }
}
BLI_init_threads(&threads, do_bake_thread, re->r.threads);
@@ -2686,7 +2687,11 @@ int RE_bake_shade_all_selected(Render *re, int type, Object *actob, short *do_up
for(ima= G.main->image.first; ima; ima= ima->id.next) {
if((ima->id.flag & LIB_DOIT)==0) {
ImBuf *ibuf= BKE_image_get_ibuf(ima, NULL);
- if (re->r.bake_filter) {
+
+ if(!ibuf)
+ continue;
+
+ if(re->r.bake_filter) {
if (usemask) {
/* extend the mask +2 pixels from the image,
* this is so colors dont blend in from outside */
@@ -2716,6 +2721,7 @@ int RE_bake_shade_all_selected(Render *re, int type, Object *actob, short *do_up
ibuf->userdata= NULL;
}
}
+
ibuf->userflags |= IB_BITMAPDIRTY;
if (ibuf->rect_float) IMB_rect_from_float(ibuf);
}