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
path: root/source
diff options
context:
space:
mode:
authorSergey Sharybin <sergey.vfx@gmail.com>2014-09-29 18:51:00 +0400
committerSergey Sharybin <sergey.vfx@gmail.com>2014-10-03 17:09:28 +0400
commit89c834143e0fabf21957dc0201761b0331c60d07 (patch)
treeed77bbe54de2f31f4df842c3e834a3bae59d5e73 /source
parent873954108a0ff034bfbe41a1e15f1e0ad48882d1 (diff)
Fix BI viewport render crash happening with zero render border area
This is better to be backported to the 2.72.
Diffstat (limited to 'source')
-rw-r--r--source/blender/render/intern/source/pipeline.c36
1 files changed, 19 insertions, 17 deletions
diff --git a/source/blender/render/intern/source/pipeline.c b/source/blender/render/intern/source/pipeline.c
index 7e6d2122330..a4d4563cb63 100644
--- a/source/blender/render/intern/source/pipeline.c
+++ b/source/blender/render/intern/source/pipeline.c
@@ -699,25 +699,27 @@ static void render_result_rescale(Render *re)
RR_USE_MEM,
RR_ALL_LAYERS);
- dst_rectf = re->result->rectf;
- if (dst_rectf == NULL) {
- RenderLayer *rl;
- rl = render_get_active_layer(re, re->result);
- if (rl != NULL) {
- dst_rectf = rl->rectf;
+ if (re->result != NULL) {
+ dst_rectf = re->result->rectf;
+ if (dst_rectf == NULL) {
+ RenderLayer *rl;
+ rl = render_get_active_layer(re, re->result);
+ if (rl != NULL) {
+ dst_rectf = rl->rectf;
+ }
}
- }
- scale_x = (float) result->rectx / re->result->rectx;
- scale_y = (float) result->recty / re->result->recty;
- for (x = 0; x < re->result->rectx; ++x) {
- for (y = 0; y < re->result->recty; ++y) {
- int src_x = x * scale_x,
- src_y = y * scale_y;
- int dst_index = y * re->result->rectx + x,
- src_index = src_y * result->rectx + src_x;
- copy_v4_v4(dst_rectf + dst_index * 4,
- src_rectf + src_index * 4);
+ scale_x = (float) result->rectx / re->result->rectx;
+ scale_y = (float) result->recty / re->result->recty;
+ for (x = 0; x < re->result->rectx; ++x) {
+ for (y = 0; y < re->result->recty; ++y) {
+ int src_x = x * scale_x,
+ src_y = y * scale_y;
+ int dst_index = y * re->result->rectx + x,
+ src_index = src_y * result->rectx + src_x;
+ copy_v4_v4(dst_rectf + dst_index * 4,
+ src_rectf + src_index * 4);
+ }
}
}
}