|
|
|
|
@@ -140,7 +140,7 @@ static void read_videoscape_mesh(char *str)
|
|
|
|
|
float *vertdata, *vd, min[3], max[3], cent[3], ftemp;
|
|
|
|
|
unsigned int color[32], col;
|
|
|
|
|
int totcol, a, b, verts, tottria=0, totquad=0, totedge=0, poly, nr0, nr, first;
|
|
|
|
|
short end;
|
|
|
|
|
int end;
|
|
|
|
|
char s[50];
|
|
|
|
|
|
|
|
|
|
fp= fopen(str, "rb");
|
|
|
|
|
@@ -158,7 +158,7 @@ static void read_videoscape_mesh(char *str)
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if(verts>65000) {
|
|
|
|
|
if(verts>2000000000L) {
|
|
|
|
|
error("too many vertices");
|
|
|
|
|
fclose(fp);
|
|
|
|
|
return;
|
|
|
|
|
@@ -202,7 +202,7 @@ static void read_videoscape_mesh(char *str)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if(totedge+tottria+totquad>65000) {
|
|
|
|
|
if(totedge+tottria+totquad>2000000000L) {
|
|
|
|
|
printf(" var1: %d, var2: %d, var3: %d \n", totedge, tottria, totquad);
|
|
|
|
|
error("too many faces");
|
|
|
|
|
MEM_freeN(vertdata);
|
|
|
|
|
@@ -357,7 +357,7 @@ static void read_radiogour(char *str)
|
|
|
|
|
float *vertdata, *vd, min[3], max[3], cent[3], ftemp;
|
|
|
|
|
unsigned int *colv, *colf, *colvertdata;
|
|
|
|
|
int itemp, a, b, verts, tottria=0, totquad=0, totedge=0, poly, nr0, nr, first;
|
|
|
|
|
short end;
|
|
|
|
|
int end;
|
|
|
|
|
char s[50];
|
|
|
|
|
|
|
|
|
|
fp= fopen(str, "rb");
|
|
|
|
|
@@ -375,7 +375,7 @@ static void read_radiogour(char *str)
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if(verts>65000) {
|
|
|
|
|
if(verts>2000000000L) {
|
|
|
|
|
error("too many vertices");
|
|
|
|
|
fclose(fp);
|
|
|
|
|
return;
|
|
|
|
|
@@ -410,7 +410,7 @@ static void read_radiogour(char *str)
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if(totedge+tottria+totquad>65000) {
|
|
|
|
|
if(totedge+tottria+totquad>2000000000L) {
|
|
|
|
|
printf(" var1: %d, var2: %d, var3: %d \n", totedge, tottria, totquad);
|
|
|
|
|
error("too many faces");
|
|
|
|
|
MEM_freeN(vertdata);
|
|
|
|
|
@@ -683,7 +683,7 @@ static void read_videoscape_nurbs(char *str)
|
|
|
|
|
static void read_videoscape(char *str)
|
|
|
|
|
{
|
|
|
|
|
int file, type;
|
|
|
|
|
unsigned short val, numlen;
|
|
|
|
|
unsigned int val, numlen;
|
|
|
|
|
char name[FILE_MAXDIR+FILE_MAXFILE], head[FILE_MAXFILE], tail[FILE_MAXFILE];
|
|
|
|
|
|
|
|
|
|
strcpy(name, str);
|
|
|
|
|
@@ -1672,8 +1672,8 @@ static void displist_to_mesh(DispList *dlfirst)
|
|
|
|
|
if(totvert==0) {
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
if(totvert>=65000 || tottria>=65000) {
|
|
|
|
|
if (totvert>=65000) {
|
|
|
|
|
if(totvert>=2000000000L || tottria>=2000000000L) {
|
|
|
|
|
if (totvert>=2000000000L) {
|
|
|
|
|
error("Too many vertices (%d)", totvert);
|
|
|
|
|
} else {
|
|
|
|
|
error("Too many faces (%d)", tottria);
|
|
|
|
|
@@ -2234,7 +2234,7 @@ void write_videoscape(char *str)
|
|
|
|
|
{
|
|
|
|
|
Base *base;
|
|
|
|
|
int file, val, lampdone=0;
|
|
|
|
|
unsigned short numlen;
|
|
|
|
|
unsigned int numlen;
|
|
|
|
|
char head[FILE_MAXFILE], tail[FILE_MAXFILE];
|
|
|
|
|
|
|
|
|
|
if(BLI_testextensie(str,".trace")) str[ strlen(str)-6]= 0;
|
|
|
|
|
@@ -3284,7 +3284,7 @@ static void dxf_read_line(int noob) {
|
|
|
|
|
/* Check to see if we need to make a new object */
|
|
|
|
|
|
|
|
|
|
if(!lwasline || strcmp(layname, oldllay)!=0) dxf_close_line();
|
|
|
|
|
if(linemhold != NULL && linemhold->totvert>65000) dxf_close_line();
|
|
|
|
|
if(linemhold != NULL && linemhold->totvert>2000000000L) dxf_close_line();
|
|
|
|
|
|
|
|
|
|
if (linemhold==NULL) {
|
|
|
|
|
if (noob) {
|
|
|
|
|
@@ -3432,7 +3432,7 @@ static void dxf_read_polyline(int noob) {
|
|
|
|
|
|
|
|
|
|
if (flag&1) {
|
|
|
|
|
if(!lwasp2d || strcmp(layname, oldplay)!=0) dxf_close_2dpoly();
|
|
|
|
|
if(p2dmhold != NULL && p2dmhold->totvert>65000) dxf_close_2dpoly();
|
|
|
|
|
if(p2dmhold != NULL && p2dmhold->totvert>2000000000L) dxf_close_2dpoly();
|
|
|
|
|
|
|
|
|
|
if (p2dmhold==NULL) {
|
|
|
|
|
if (noob) {
|
|
|
|
|
@@ -3592,7 +3592,8 @@ static void dxf_read_polyline(int noob) {
|
|
|
|
|
me->totvert++;
|
|
|
|
|
|
|
|
|
|
/* If we are nearing the limit scan to the next entry */
|
|
|
|
|
if(me->totvert > 65000) while(group_isnt(0, "SEQEND")) read_group(id, val);
|
|
|
|
|
if(me->totvert > 2000000000L)
|
|
|
|
|
while(group_isnt(0, "SEQEND")) read_group(id, val);
|
|
|
|
|
|
|
|
|
|
vtmp= MEM_callocN(me->totvert*sizeof(MVert), "mverts");
|
|
|
|
|
|
|
|
|
|
@@ -3771,7 +3772,7 @@ static void dxf_read_3dface(int noob)
|
|
|
|
|
/* Check to see if we need to make a new object */
|
|
|
|
|
|
|
|
|
|
if(!lwasf3d || strcmp(layname, oldflay)!=0) dxf_close_3dface();
|
|
|
|
|
if(f3dmhold != NULL && f3dmhold->totvert>65000) dxf_close_3dface();
|
|
|
|
|
if(f3dmhold != NULL && f3dmhold->totvert>2000000000L) dxf_close_3dface();
|
|
|
|
|
|
|
|
|
|
if(nverts<3) {
|
|
|
|
|
error("(3DF) Error parsing dxf, not enough vertices near line %d", dxf_line);
|
|
|
|
|
|