From 8be045612bc4901ba5322ae589796b23867fc4a4 Mon Sep 17 00:00:00 2001 From: Hermet Park Date: Tue, 6 Dec 2016 19:18:09 +0900 Subject: [PATCH] static_libs triangulator: prevent null pointer(ptr) access. --- .../triangulator/triangulator_stroker.c | 32 +++++++++---------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/src/static_libs/triangulator/triangulator_stroker.c b/src/static_libs/triangulator/triangulator_stroker.c index 44f7b8946b..18f7ead976 100644 --- a/src/static_libs/triangulator/triangulator_stroker.c +++ b/src/static_libs/triangulator/triangulator_stroker.c @@ -156,23 +156,23 @@ move_to(Triangulator_Stroker *stroker, const double *pts) ptr1 = eina_inarray_nth(stroker->arc_pts, 0); ptr = eina_inarray_nth(stroker->vertices, 0); i = pts_count; - } - while (front != end) - { - ptr[--i] = ptr1[2 * end - 1]; - ptr[--i] = ptr1[2 * end - 2]; - --end; - if (front == end) - break; - ptr[--i] = ptr1[2 * front + 1]; - ptr[--i] = ptr1[2 * front + 0]; - ++front; - } - if (jump) - { - ptr[i - 1] = ptr[i + 1]; - ptr[i - 2] = ptr[i + 0]; + while (front != end) + { + ptr[--i] = ptr1[2 * end - 1]; + ptr[--i] = ptr1[2 * end - 2]; + --end; + if (front == end) + break; + ptr[--i] = ptr1[2 * front + 1]; + ptr[--i] = ptr1[2 * front + 0]; + ++front; + } + if (jump) + { + ptr[i - 1] = ptr[i + 1]; + ptr[i - 2] = ptr[i + 0]; + } } break; }