u_long space = sizeof(TIFFHeader) + sizeof(short) + ((long)dircount * sizeof(TIFFDirEntry)) + sizeof(long); /* calculate amount of space used by indirect values */
for (dp = dir, n = dircount; n > 0; n--, dp++) {
int cc = (int)dp->tdir_count * datawidth[dp->tdir_type];