diff options
author | Campbell Barton <ideasman42@gmail.com> | 2010-09-21 16:27:09 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2010-09-21 16:27:09 +0400 |
commit | 3f18d7bb9b762353232f83ef8ee3c755f31b5869 (patch) | |
tree | c6fa3732e5823186e726f6ad08dfc85439d277bf /source/blender/editors/transform/transform_conversions.c | |
parent | 8b725299427e9c3c5b3870b3c5bdfe9264ba5d08 (diff) |
bugfix [#23927] Crash proportional editing: connected
crash when using too much stack memory, each recursive call for the sorting function would allocate 200 bytes in TransData per call (64bit os), now pass this as an argument.
Diffstat (limited to 'source/blender/editors/transform/transform_conversions.c')
-rw-r--r-- | source/blender/editors/transform/transform_conversions.c | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/source/blender/editors/transform/transform_conversions.c b/source/blender/editors/transform/transform_conversions.c index 5609b7068b3..519e5eae0eb 100644 --- a/source/blender/editors/transform/transform_conversions.c +++ b/source/blender/editors/transform/transform_conversions.c @@ -102,20 +102,19 @@ static short constraints_list_needinv(TransInfo *t, ListBase *list); /* ************************** Functions *************************** */ -static void qsort_trans_data(TransInfo *t, TransData *head, TransData *tail) { - TransData pivot = *head; +static void qsort_trans_data(TransInfo *t, TransData *head, TransData *tail, TransData *temp) { TransData *ihead = head; TransData *itail = tail; - short connected = t->flag & T_PROP_CONNECTED; + *temp = *head; while (head < tail) { - if (connected) { - while ((tail->dist >= pivot.dist) && (head < tail)) + if (t->flag & T_PROP_CONNECTED) { + while ((tail->dist >= temp->dist) && (head < tail)) tail--; } else { - while ((tail->rdist >= pivot.rdist) && (head < tail)) + while ((tail->rdist >= temp->rdist) && (head < tail)) tail--; } @@ -125,12 +124,12 @@ static void qsort_trans_data(TransInfo *t, TransData *head, TransData *tail) { head++; } - if (connected) { - while ((head->dist <= pivot.dist) && (head < tail)) + if (t->flag & T_PROP_CONNECTED) { + while ((head->dist <= temp->dist) && (head < tail)) head++; } else { - while ((head->rdist <= pivot.rdist) && (head < tail)) + while ((head->rdist <= temp->rdist) && (head < tail)) head++; } @@ -141,16 +140,17 @@ static void qsort_trans_data(TransInfo *t, TransData *head, TransData *tail) { } } - *head = pivot; + *head = *temp; if (ihead < head) { - qsort_trans_data(t, ihead, head-1); + qsort_trans_data(t, ihead, head-1, temp); } if (itail > head) { - qsort_trans_data(t, head+1, itail); + qsort_trans_data(t, head+1, itail, temp); } } void sort_trans_data_dist(TransInfo *t) { + TransData temp; TransData *start = t->data; int i = 1; @@ -158,7 +158,7 @@ void sort_trans_data_dist(TransInfo *t) { start++; i++; } - qsort_trans_data(t, start, t->data + t->total - 1); + qsort_trans_data(t, start, t->data + t->total - 1, &temp); } static void sort_trans_data(TransInfo *t) |