![]() |
【转帖】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 |
所有的时间均为北京时间。 现在的时间是 02:36 PM. |