const float *data = node->mPath.ptPtr;
if (!data) continue;
- Tvg_Paint* shape = tvg_shape_new();
//0: Path
uint32_t cmdCnt = node->mPath.elmCount;
uint32_t ptsCnt = node->mPath.ptCount * sizeof(float) / sizeof(Tvg_Point);
- Tvg_Path_Command cmds[cmdCnt];
- Tvg_Point pts[ptsCnt];
+ if (cmdCnt == 0 || ptsCnt == 0) continue;
+
+ Tvg_Paint* shape = tvg_shape_new();
+
+ Tvg_Path_Command* cmds = static_cast<Tvg_Path_Command*>(alloca(sizeof(Tvg_Path_Command) * cmdCnt));
+ Tvg_Point* pts = static_cast<Tvg_Point*>(alloca(sizeof(Tvg_Point) * ptsCnt));
uint32_t cmd_i = 0, pts_i = 0;
for (uint32_t i = 0; i < cmdCnt; i++)
const float *data = mask->mPath.ptPtr;
if (!data) return;
- Tvg_Paint* shape = tvg_shape_new();
//Path
uint32_t cmdCnt = mask->mPath.elmCount;
uint32_t ptsCnt = mask->mPath.ptCount * sizeof(float) / sizeof(Tvg_Point);
- Tvg_Path_Command cmds[cmdCnt];
- Tvg_Point pts[ptsCnt];
+ if (cmdCnt == 0 || ptsCnt == 0) return;
+
+ Tvg_Paint* shape = tvg_shape_new();
+
+ Tvg_Path_Command* cmds = static_cast<Tvg_Path_Command*>(alloca(sizeof(Tvg_Path_Command) * cmdCnt));
+ Tvg_Point* pts = static_cast<Tvg_Point*>(alloca(sizeof(Tvg_Point) * ptsCnt));
uint32_t cmd_i = 0, pts_i = 0;
for (uint32_t i = 0; i < cmdCnt; i++)