查看单个帖子
旧 2009-05-06, 09:40 PM   #1
yang686526
高级会员
 
注册日期: 06-11
帖子: 14579
精华: 1
现金: 224494 标准币
资产: 234494 标准币
yang686526 向着好的方向发展
默认 【转帖】parameter validation in polygon clipper

parameter validation in polygon clipper
parameter validation in polygon clipper
hey guys,
i'm currently using dwgdirect 2.2.0.0.
there was a .dwg file that was causing some problems with passing null for edges and some other similar situations, which was causing a fault as my version of the code didn't seem to be parameter validating.
i did put in some parameter validation, but just pinging to see if there have been any changes already made.
i'm attaching my code, but the upshot is similar to this little snippet:
code:
static void add_left(polygon_node *p, double x, double y)
{
vertex_node *nv;
/* added this check. */
if(!p)
return;
/* create a new vertex node and set its fields */
malloc(nv, sizeof(vertex_node), "vertex node creation", vertex_node);
nv->x= x;
nv->y= y;
nv->next = null;
/* add vertex nv to the left end of the polygon's vertex list */
nv->next= p->proxy->v[left];
/* update proxy->[left] to point to nv */
p->proxy->v[left]= nv;
}and similar checks are sprinkled through the other functions in this file, avgpc.c which is in the dwgdirect\source\ge directory.
also i could send along the dwg if anyone's interested.
thanks!
attached files
thank you.
can you send also the file that was causing the clipper to fail?
vladimir
yang686526离线中   回复时引用此帖
GDT自动化论坛(仅游客可见)