66 |
|
else |
67 |
|
printf("\t%.3e\n", bsdf); |
68 |
|
} |
69 |
< |
free(rbf); |
69 |
> |
if (rbf != NULL) |
70 |
> |
free(rbf); |
71 |
|
} |
72 |
|
if (pctcull >= 0) { /* finish output */ |
73 |
|
if (pclose(ofp)) { |
128 |
|
else |
129 |
|
printf("\t%.3e\n", bsdf); |
130 |
|
} |
131 |
< |
free(rbf); |
131 |
> |
if (rbf != NULL) |
132 |
> |
free(rbf); |
133 |
|
} |
134 |
|
if (pctcull >= 0) { /* finish output */ |
135 |
|
if (pclose(ofp)) { |
162 |
|
} |
163 |
|
argv += 2; argc -= 2; |
164 |
|
} |
165 |
< |
if (argc == 2) |
165 |
> |
if (argc == 2) { /* open input if given */ |
166 |
|
fpin = fopen(argv[1], "r"); |
167 |
< |
else if (argc != 1) |
167 |
> |
if (fpin == NULL) { |
168 |
> |
fprintf(stderr, "%s: cannot open BSDF interpolant '%s'\n", |
169 |
> |
progname, argv[1]); |
170 |
> |
return(1); |
171 |
> |
} |
172 |
> |
} else if (argc != 1) |
173 |
|
goto userr; |
174 |
|
SET_FILE_BINARY(fpin); /* load BSDF interpolant */ |
175 |
|
if (!load_bsdf_rep(fpin)) |
176 |
|
return(1); |
170 |
– |
draw_edges(); |
177 |
|
/* xml_prologue(); /* start XML output */ |
178 |
|
if (single_plane_incident) /* resample dist. */ |
179 |
|
interp_isotropic(); |