cherry-pick from upstream
authorHermet Park <hermet@hermet.pe.kr>
Tue, 6 Dec 2016 10:20:08 +0000 (19:20 +0900)
committerWonki Kim <wonki_.kim@samsung.com>
Mon, 2 Jan 2017 07:23:58 +0000 (16:23 +0900)
http://git.enlightenment.org/core/efl.git/commit/?id=8be045612bc4901ba5322ae589796b23867fc4a4

commit 8be045612bc4901ba5322ae589796b23867fc4a4
Author: Hermet Park <hermet@hermet.pe.kr>
Date:   Tue Dec 6 19:18:09 2016 +0900

    static_libs triangulator: prevent null pointer(ptr) access.

Change-Id: Ia004f1e5c1518590d77b44f7198464ce0aa841fb

src/static_libs/triangulator/triangulator_stroker.c

index 69c4027..c9ac988 100644 (file)
@@ -171,23 +171,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;
          }