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:
authorTon Roosendaal <ton@blender.org>2004-10-27 13:59:25 +0400
committerTon Roosendaal <ton@blender.org>2004-10-27 13:59:25 +0400
commit53da078c564a79d40f9ddf60eac3846590fd57a8 (patch)
tree5d4649460e330fa9257cc623aedd73820c308394 /source
parent0512a1032c6bddafe956e63a019cc5f2baf3a534 (diff)
Fix for #1691
Using octree resolution 512 easily could overflow fixed sized array that holds all node branches. Had to jack that up...
Diffstat (limited to 'source')
-rw-r--r--source/blender/render/intern/source/ray.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/source/blender/render/intern/source/ray.c b/source/blender/render/intern/source/ray.c
index 4482ed31ef6..b698c525140 100644
--- a/source/blender/render/intern/source/ray.c
+++ b/source/blender/render/intern/source/ray.c
@@ -62,8 +62,10 @@
/* ********** structs *************** */
+#define BRANCH_ARRAY 1024
+
typedef struct Octree {
- struct Branch *adrbranch[256];
+ struct Branch *adrbranch[BRANCH_ARRAY];
struct Node *adrnode[4096];
float ocsize; /* ocsize: mult factor, max size octree */
float ocfacx,ocfacy,ocfacz;
@@ -199,7 +201,7 @@ static Branch *addbranch(Branch *br, short oc)
if(g_oc.adrbranch[branchcount>>12]==NULL)
g_oc.adrbranch[branchcount>>12]= MEM_callocN(4096*sizeof(Branch),"addbranch");
- if(branchcount>= 256*4096) {
+ if(branchcount>= BRANCH_ARRAY*4096) {
printf("error; octree branches full\n");
branchcount=0;
}