Lines 29-34
Link Here
|
29 |
* |
29 |
* |
30 |
* Directory Read Support Routines. |
30 |
* Directory Read Support Routines. |
31 |
*/ |
31 |
*/ |
|
|
32 |
|
33 |
#include <limits.h> |
34 |
|
32 |
#include "tiffiop.h" |
35 |
#include "tiffiop.h" |
33 |
|
36 |
|
34 |
#define IGNORE 0 /* tag placeholder used below */ |
37 |
#define IGNORE 0 /* tag placeholder used below */ |
Lines 81-86
Link Here
|
81 |
uint16 dircount; |
84 |
uint16 dircount; |
82 |
toff_t nextdiroff; |
85 |
toff_t nextdiroff; |
83 |
int diroutoforderwarning = 0; |
86 |
int diroutoforderwarning = 0; |
|
|
87 |
int compressionknown = 0; |
84 |
toff_t* new_dirlist; |
88 |
toff_t* new_dirlist; |
85 |
|
89 |
|
86 |
tif->tif_diroff = tif->tif_nextdiroff; |
90 |
tif->tif_diroff = tif->tif_nextdiroff; |
Lines 147-159
Link Here
|
147 |
} else { |
151 |
} else { |
148 |
toff_t off = tif->tif_diroff; |
152 |
toff_t off = tif->tif_diroff; |
149 |
|
153 |
|
150 |
if (off + sizeof (uint16) > tif->tif_size) { |
154 |
/* |
151 |
TIFFErrorExt(tif->tif_clientdata, module, |
155 |
* Check for integer overflow when validating the dir_off, otherwise |
152 |
"%s: Can not read TIFF directory count", |
156 |
* a very high offset may cause an OOB read and crash the client. |
153 |
tif->tif_name); |
157 |
* -- taviso@google.com, 14 Jun 2006. |
154 |
return (0); |
158 |
*/ |
|
|
159 |
if (off + sizeof (uint16) > tif->tif_size || |
160 |
off > (UINT_MAX - sizeof(uint16))) { |
161 |
TIFFErrorExt(tif->tif_clientdata, module, |
162 |
"%s: Can not read TIFF directory count", |
163 |
tif->tif_name); |
164 |
return (0); |
155 |
} else |
165 |
} else |
156 |
_TIFFmemcpy(&dircount, tif->tif_base + off, sizeof (uint16)); |
166 |
_TIFFmemcpy(&dircount, tif->tif_base + off, |
|
|
167 |
sizeof (uint16)); |
157 |
off += sizeof (uint16); |
168 |
off += sizeof (uint16); |
158 |
if (tif->tif_flags & TIFF_SWAB) |
169 |
if (tif->tif_flags & TIFF_SWAB) |
159 |
TIFFSwabShort(&dircount); |
170 |
TIFFSwabShort(&dircount); |
Lines 254-259
Link Here
|
254 |
while (fix < tif->tif_nfields && |
265 |
while (fix < tif->tif_nfields && |
255 |
tif->tif_fieldinfo[fix]->field_tag < dp->tdir_tag) |
266 |
tif->tif_fieldinfo[fix]->field_tag < dp->tdir_tag) |
256 |
fix++; |
267 |
fix++; |
|
|
268 |
|
257 |
if (fix >= tif->tif_nfields || |
269 |
if (fix >= tif->tif_nfields || |
258 |
tif->tif_fieldinfo[fix]->field_tag != dp->tdir_tag) { |
270 |
tif->tif_fieldinfo[fix]->field_tag != dp->tdir_tag) { |
259 |
|
271 |
|
Lines 264-280
Link Here
|
264 |
dp->tdir_tag, |
276 |
dp->tdir_tag, |
265 |
dp->tdir_tag, |
277 |
dp->tdir_tag, |
266 |
dp->tdir_type); |
278 |
dp->tdir_type); |
267 |
|
279 |
/* |
268 |
TIFFMergeFieldInfo(tif, |
280 |
* creating anonymous fields prior to knowing the compression |
269 |
_TIFFCreateAnonFieldInfo(tif, |
281 |
* algorithm (ie, when the field info has been merged) could cause |
270 |
dp->tdir_tag, |
282 |
* crashes with pathological directories. |
271 |
(TIFFDataType) dp->tdir_type), |
283 |
* -- taviso@google.com 15 Jun 2006 |
272 |
1 ); |
284 |
*/ |
|
|
285 |
if (compressionknown) |
286 |
TIFFMergeFieldInfo(tif, _TIFFCreateAnonFieldInfo(tif, dp->tdir_tag, |
287 |
(TIFFDataType) dp->tdir_type), 1 ); |
288 |
else goto ignore; |
289 |
|
273 |
fix = 0; |
290 |
fix = 0; |
274 |
while (fix < tif->tif_nfields && |
291 |
while (fix < tif->tif_nfields && |
275 |
tif->tif_fieldinfo[fix]->field_tag < dp->tdir_tag) |
292 |
tif->tif_fieldinfo[fix]->field_tag < dp->tdir_tag) |
276 |
fix++; |
293 |
fix++; |
277 |
} |
294 |
} |
|
|
295 |
|
278 |
/* |
296 |
/* |
279 |
* Null out old tags that we ignore. |
297 |
* Null out old tags that we ignore. |
280 |
*/ |
298 |
*/ |
Lines 326-331
Link Here
|
326 |
dp->tdir_type, dp->tdir_offset); |
344 |
dp->tdir_type, dp->tdir_offset); |
327 |
if (!TIFFSetField(tif, dp->tdir_tag, (uint16)v)) |
345 |
if (!TIFFSetField(tif, dp->tdir_tag, (uint16)v)) |
328 |
goto bad; |
346 |
goto bad; |
|
|
347 |
else compressionknown++; |
329 |
break; |
348 |
break; |
330 |
/* XXX: workaround for broken TIFFs */ |
349 |
/* XXX: workaround for broken TIFFs */ |
331 |
} else if (dp->tdir_type == TIFF_LONG) { |
350 |
} else if (dp->tdir_type == TIFF_LONG) { |
Lines 540-545
Link Here
|
540 |
* Attempt to deal with a missing StripByteCounts tag. |
559 |
* Attempt to deal with a missing StripByteCounts tag. |
541 |
*/ |
560 |
*/ |
542 |
if (!TIFFFieldSet(tif, FIELD_STRIPBYTECOUNTS)) { |
561 |
if (!TIFFFieldSet(tif, FIELD_STRIPBYTECOUNTS)) { |
|
|
562 |
const TIFFFieldInfo* fip = _TIFFFieldWithTag(tif, TIFFTAG_STRIPBYTECOUNTS); |
543 |
/* |
563 |
/* |
544 |
* Some manufacturers violate the spec by not giving |
564 |
* Some manufacturers violate the spec by not giving |
545 |
* the size of the strips. In this case, assume there |
565 |
* the size of the strips. In this case, assume there |
Lines 556-562
Link Here
|
556 |
"%s: TIFF directory is missing required " |
576 |
"%s: TIFF directory is missing required " |
557 |
"\"%s\" field, calculating from imagelength", |
577 |
"\"%s\" field, calculating from imagelength", |
558 |
tif->tif_name, |
578 |
tif->tif_name, |
559 |
_TIFFFieldWithTag(tif,TIFFTAG_STRIPBYTECOUNTS)->field_name); |
579 |
fip ? fip->field_name : "Unknown"); |
560 |
if (EstimateStripByteCounts(tif, dir, dircount) < 0) |
580 |
if (EstimateStripByteCounts(tif, dir, dircount) < 0) |
561 |
goto bad; |
581 |
goto bad; |
562 |
/* |
582 |
/* |
Lines 580-585
Link Here
|
580 |
} else if (td->td_nstrips == 1 |
600 |
} else if (td->td_nstrips == 1 |
581 |
&& td->td_stripoffset[0] != 0 |
601 |
&& td->td_stripoffset[0] != 0 |
582 |
&& BYTECOUNTLOOKSBAD) { |
602 |
&& BYTECOUNTLOOKSBAD) { |
|
|
603 |
const TIFFFieldInfo* fip = _TIFFFieldWithTag(tif, TIFFTAG_STRIPBYTECOUNTS); |
583 |
/* |
604 |
/* |
584 |
* XXX: Plexus (and others) sometimes give a value of zero for |
605 |
* XXX: Plexus (and others) sometimes give a value of zero for |
585 |
* a tag when they don't know what the correct value is! Try |
606 |
* a tag when they don't know what the correct value is! Try |
Lines 589-601
Link Here
|
589 |
TIFFWarningExt(tif->tif_clientdata, module, |
610 |
TIFFWarningExt(tif->tif_clientdata, module, |
590 |
"%s: Bogus \"%s\" field, ignoring and calculating from imagelength", |
611 |
"%s: Bogus \"%s\" field, ignoring and calculating from imagelength", |
591 |
tif->tif_name, |
612 |
tif->tif_name, |
592 |
_TIFFFieldWithTag(tif,TIFFTAG_STRIPBYTECOUNTS)->field_name); |
613 |
fip ? fip->field_name : "Unknown"); |
593 |
if(EstimateStripByteCounts(tif, dir, dircount) < 0) |
614 |
if(EstimateStripByteCounts(tif, dir, dircount) < 0) |
594 |
goto bad; |
615 |
goto bad; |
595 |
} else if (td->td_planarconfig == PLANARCONFIG_CONTIG |
616 |
} else if (td->td_planarconfig == PLANARCONFIG_CONTIG |
596 |
&& td->td_nstrips > 2 |
617 |
&& td->td_nstrips > 2 |
597 |
&& td->td_compression == COMPRESSION_NONE |
618 |
&& td->td_compression == COMPRESSION_NONE |
598 |
&& td->td_stripbytecount[0] != td->td_stripbytecount[1]) { |
619 |
&& td->td_stripbytecount[0] != td->td_stripbytecount[1]) { |
|
|
620 |
const TIFFFieldInfo* fip = _TIFFFieldWithTag(tif, TIFFTAG_STRIPBYTECOUNTS); |
599 |
/* |
621 |
/* |
600 |
* XXX: Some vendors fill StripByteCount array with absolutely |
622 |
* XXX: Some vendors fill StripByteCount array with absolutely |
601 |
* wrong values (it can be equal to StripOffset array, for |
623 |
* wrong values (it can be equal to StripOffset array, for |
Lines 604-610
Link Here
|
604 |
TIFFWarningExt(tif->tif_clientdata, module, |
626 |
TIFFWarningExt(tif->tif_clientdata, module, |
605 |
"%s: Wrong \"%s\" field, ignoring and calculating from imagelength", |
627 |
"%s: Wrong \"%s\" field, ignoring and calculating from imagelength", |
606 |
tif->tif_name, |
628 |
tif->tif_name, |
607 |
_TIFFFieldWithTag(tif,TIFFTAG_STRIPBYTECOUNTS)->field_name); |
629 |
fip ? fip->field_name : "Unknown"); |
608 |
if (EstimateStripByteCounts(tif, dir, dircount) < 0) |
630 |
if (EstimateStripByteCounts(tif, dir, dircount) < 0) |
609 |
goto bad; |
631 |
goto bad; |
610 |
} |
632 |
} |
Lines 870-876
Link Here
|
870 |
|
892 |
|
871 |
register TIFFDirEntry *dp; |
893 |
register TIFFDirEntry *dp; |
872 |
register TIFFDirectory *td = &tif->tif_dir; |
894 |
register TIFFDirectory *td = &tif->tif_dir; |
873 |
uint16 i; |
895 |
|
|
|
896 |
/* i is used to iterate over td->td_nstrips, so must be |
897 |
* at least the same width. |
898 |
* -- taviso@google.com 15 Jun 2006 |
899 |
*/ |
900 |
|
901 |
uint32 i; |
874 |
|
902 |
|
875 |
if (td->td_stripbytecount) |
903 |
if (td->td_stripbytecount) |
876 |
_TIFFfree(td->td_stripbytecount); |
904 |
_TIFFfree(td->td_stripbytecount); |
Lines 947-962
Link Here
|
947 |
static int |
975 |
static int |
948 |
CheckDirCount(TIFF* tif, TIFFDirEntry* dir, uint32 count) |
976 |
CheckDirCount(TIFF* tif, TIFFDirEntry* dir, uint32 count) |
949 |
{ |
977 |
{ |
|
|
978 |
const TIFFFieldInfo* fip = _TIFFFieldWithTag(tif, dir->tdir_tag); |
979 |
|
950 |
if (count > dir->tdir_count) { |
980 |
if (count > dir->tdir_count) { |
951 |
TIFFWarningExt(tif->tif_clientdata, tif->tif_name, |
981 |
TIFFWarningExt(tif->tif_clientdata, tif->tif_name, |
952 |
"incorrect count for field \"%s\" (%lu, expecting %lu); tag ignored", |
982 |
"incorrect count for field \"%s\" (%lu, expecting %lu); tag ignored", |
953 |
_TIFFFieldWithTag(tif, dir->tdir_tag)->field_name, |
983 |
fip ? fip->field_name : "Unknown", |
954 |
dir->tdir_count, count); |
984 |
dir->tdir_count, count); |
955 |
return (0); |
985 |
return (0); |
956 |
} else if (count < dir->tdir_count) { |
986 |
} else if (count < dir->tdir_count) { |
957 |
TIFFWarningExt(tif->tif_clientdata, tif->tif_name, |
987 |
TIFFWarningExt(tif->tif_clientdata, tif->tif_name, |
958 |
"incorrect count for field \"%s\" (%lu, expecting %lu); tag trimmed", |
988 |
"incorrect count for field \"%s\" (%lu, expecting %lu); tag trimmed", |
959 |
_TIFFFieldWithTag(tif, dir->tdir_tag)->field_name, |
989 |
fip ? fip->field_name : "Unknown", |
960 |
dir->tdir_count, count); |
990 |
dir->tdir_count, count); |
961 |
return (1); |
991 |
return (1); |
962 |
} |
992 |
} |
Lines 970-975
Link Here
|
970 |
TIFFFetchData(TIFF* tif, TIFFDirEntry* dir, char* cp) |
1000 |
TIFFFetchData(TIFF* tif, TIFFDirEntry* dir, char* cp) |
971 |
{ |
1001 |
{ |
972 |
int w = TIFFDataWidth((TIFFDataType) dir->tdir_type); |
1002 |
int w = TIFFDataWidth((TIFFDataType) dir->tdir_type); |
|
|
1003 |
const TIFFFieldInfo* fip = _TIFFFieldWithTag(tif, dir->tdir_tag); |
973 |
tsize_t cc = dir->tdir_count * w; |
1004 |
tsize_t cc = dir->tdir_count * w; |
974 |
|
1005 |
|
975 |
/* Check for overflow. */ |
1006 |
/* Check for overflow. */ |
Lines 1013-1019
Link Here
|
1013 |
bad: |
1044 |
bad: |
1014 |
TIFFErrorExt(tif->tif_clientdata, tif->tif_name, |
1045 |
TIFFErrorExt(tif->tif_clientdata, tif->tif_name, |
1015 |
"Error fetching data for field \"%s\"", |
1046 |
"Error fetching data for field \"%s\"", |
1016 |
_TIFFFieldWithTag(tif, dir->tdir_tag)->field_name); |
1047 |
fip ? fip->field_name : "Unknown"); |
1017 |
return (tsize_t) 0; |
1048 |
return (tsize_t) 0; |
1018 |
} |
1049 |
} |
1019 |
|
1050 |
|
Lines 1039-1048
Link Here
|
1039 |
static int |
1070 |
static int |
1040 |
cvtRational(TIFF* tif, TIFFDirEntry* dir, uint32 num, uint32 denom, float* rv) |
1071 |
cvtRational(TIFF* tif, TIFFDirEntry* dir, uint32 num, uint32 denom, float* rv) |
1041 |
{ |
1072 |
{ |
|
|
1073 |
const TIFFFieldInfo* fip; |
1042 |
if (denom == 0) { |
1074 |
if (denom == 0) { |
|
|
1075 |
fip = _TIFFFieldWithTag(tif, dir->tdir_tag); |
1043 |
TIFFErrorExt(tif->tif_clientdata, tif->tif_name, |
1076 |
TIFFErrorExt(tif->tif_clientdata, tif->tif_name, |
1044 |
"%s: Rational with zero denominator (num = %lu)", |
1077 |
"%s: Rational with zero denominator (num = %lu)", |
1045 |
_TIFFFieldWithTag(tif, dir->tdir_tag)->field_name, num); |
1078 |
fip ? fip->field_name : "Unknown", num); |
1046 |
return (0); |
1079 |
return (0); |
1047 |
} else { |
1080 |
} else { |
1048 |
if (dir->tdir_type == TIFF_RATIONAL) |
1081 |
if (dir->tdir_type == TIFF_RATIONAL) |
Lines 1159-1164
Link Here
|
1159 |
static int |
1192 |
static int |
1160 |
TIFFFetchShortPair(TIFF* tif, TIFFDirEntry* dir) |
1193 |
TIFFFetchShortPair(TIFF* tif, TIFFDirEntry* dir) |
1161 |
{ |
1194 |
{ |
|
|
1195 |
/* |
1196 |
* Prevent overflowing the v stack arrays below by performing a sanity |
1197 |
* check on tdir_count, this should never be greater than two. |
1198 |
* -- taviso@google.com 14 Jun 2006. |
1199 |
*/ |
1200 |
if (dir->tdir_count > 2) { |
1201 |
const TIFFFieldInfo* fip = _TIFFFieldWithTag(tif, dir->tdir_tag); |
1202 |
TIFFWarningExt(tif->tif_clientdata, tif->tif_name, |
1203 |
"unexpected count for field \"%s\", %lu, expected 2; ignored.", |
1204 |
fip ? fip->field_name : "Unknown", |
1205 |
dir->tdir_count); |
1206 |
return 0; |
1207 |
} |
1208 |
|
1162 |
switch (dir->tdir_type) { |
1209 |
switch (dir->tdir_type) { |
1163 |
case TIFF_BYTE: |
1210 |
case TIFF_BYTE: |
1164 |
case TIFF_SBYTE: |
1211 |
case TIFF_SBYTE: |
Lines 1329-1342
Link Here
|
1329 |
case TIFF_DOUBLE: |
1376 |
case TIFF_DOUBLE: |
1330 |
return (TIFFFetchDoubleArray(tif, dir, (double*) v)); |
1377 |
return (TIFFFetchDoubleArray(tif, dir, (double*) v)); |
1331 |
default: |
1378 |
default: |
|
|
1379 |
{ const TIFFFieldInfo* fip = _TIFFFieldWithTag(tif, dir->tdir_tag); |
1332 |
/* TIFF_NOTYPE */ |
1380 |
/* TIFF_NOTYPE */ |
1333 |
/* TIFF_ASCII */ |
1381 |
/* TIFF_ASCII */ |
1334 |
/* TIFF_UNDEFINED */ |
1382 |
/* TIFF_UNDEFINED */ |
1335 |
TIFFErrorExt(tif->tif_clientdata, tif->tif_name, |
1383 |
TIFFErrorExt(tif->tif_clientdata, tif->tif_name, |
1336 |
"cannot read TIFF_ANY type %d for field \"%s\"", |
1384 |
"cannot read TIFF_ANY type %d for field \"%s\"", |
1337 |
dir->tdir_type, |
1385 |
dir->tdir_type, |
1338 |
_TIFFFieldWithTag(tif, dir->tdir_tag)->field_name); |
1386 |
fip ? fip->field_name : "Unknown"); |
1339 |
return (0); |
1387 |
return (0); } |
1340 |
} |
1388 |
} |
1341 |
return (1); |
1389 |
return (1); |
1342 |
} |
1390 |
} |
Lines 1351-1356
Link Here
|
1351 |
int ok = 0; |
1399 |
int ok = 0; |
1352 |
const TIFFFieldInfo* fip = _TIFFFieldWithTag(tif, dp->tdir_tag); |
1400 |
const TIFFFieldInfo* fip = _TIFFFieldWithTag(tif, dp->tdir_tag); |
1353 |
|
1401 |
|
|
|
1402 |
if (fip == NULL) { |
1403 |
return (0); |
1404 |
} |
1354 |
if (dp->tdir_count > 1) { /* array of values */ |
1405 |
if (dp->tdir_count > 1) { /* array of values */ |
1355 |
char* cp = NULL; |
1406 |
char* cp = NULL; |
1356 |
|
1407 |
|
Lines 1493-1498
Link Here
|
1493 |
TIFFFetchPerSampleShorts(TIFF* tif, TIFFDirEntry* dir, uint16* pl) |
1544 |
TIFFFetchPerSampleShorts(TIFF* tif, TIFFDirEntry* dir, uint16* pl) |
1494 |
{ |
1545 |
{ |
1495 |
uint16 samples = tif->tif_dir.td_samplesperpixel; |
1546 |
uint16 samples = tif->tif_dir.td_samplesperpixel; |
|
|
1547 |
const TIFFFieldInfo* fip; |
1496 |
int status = 0; |
1548 |
int status = 0; |
1497 |
|
1549 |
|
1498 |
if (CheckDirCount(tif, dir, (uint32) samples)) { |
1550 |
if (CheckDirCount(tif, dir, (uint32) samples)) { |
Lines 1510-1518
Link Here
|
1510 |
|
1562 |
|
1511 |
for (i = 1; i < check_count; i++) |
1563 |
for (i = 1; i < check_count; i++) |
1512 |
if (v[i] != v[0]) { |
1564 |
if (v[i] != v[0]) { |
|
|
1565 |
fip = _TIFFFieldWithTag(tif, dir->tdir_tag); |
1513 |
TIFFErrorExt(tif->tif_clientdata, tif->tif_name, |
1566 |
TIFFErrorExt(tif->tif_clientdata, tif->tif_name, |
1514 |
"Cannot handle different per-sample values for field \"%s\"", |
1567 |
"Cannot handle different per-sample values for field \"%s\"", |
1515 |
_TIFFFieldWithTag(tif, dir->tdir_tag)->field_name); |
1568 |
fip ? fip->field_name : "Unknown"); |
1516 |
goto bad; |
1569 |
goto bad; |
1517 |
} |
1570 |
} |
1518 |
*pl = v[0]; |
1571 |
*pl = v[0]; |
Lines 1534-1539
Link Here
|
1534 |
TIFFFetchPerSampleLongs(TIFF* tif, TIFFDirEntry* dir, uint32* pl) |
1587 |
TIFFFetchPerSampleLongs(TIFF* tif, TIFFDirEntry* dir, uint32* pl) |
1535 |
{ |
1588 |
{ |
1536 |
uint16 samples = tif->tif_dir.td_samplesperpixel; |
1589 |
uint16 samples = tif->tif_dir.td_samplesperpixel; |
|
|
1590 |
const TIFFFieldInfo* fip; |
1537 |
int status = 0; |
1591 |
int status = 0; |
1538 |
|
1592 |
|
1539 |
if (CheckDirCount(tif, dir, (uint32) samples)) { |
1593 |
if (CheckDirCount(tif, dir, (uint32) samples)) { |
Lines 1551-1559
Link Here
|
1551 |
check_count = samples; |
1605 |
check_count = samples; |
1552 |
for (i = 1; i < check_count; i++) |
1606 |
for (i = 1; i < check_count; i++) |
1553 |
if (v[i] != v[0]) { |
1607 |
if (v[i] != v[0]) { |
|
|
1608 |
fip = _TIFFFieldWithTag(tif, dir->tdir_tag); |
1554 |
TIFFErrorExt(tif->tif_clientdata, tif->tif_name, |
1609 |
TIFFErrorExt(tif->tif_clientdata, tif->tif_name, |
1555 |
"Cannot handle different per-sample values for field \"%s\"", |
1610 |
"Cannot handle different per-sample values for field \"%s\"", |
1556 |
_TIFFFieldWithTag(tif, dir->tdir_tag)->field_name); |
1611 |
fip ? fip->field_name : "Unknown"); |
1557 |
goto bad; |
1612 |
goto bad; |
1558 |
} |
1613 |
} |
1559 |
*pl = v[0]; |
1614 |
*pl = v[0]; |
Lines 1574-1579
Link Here
|
1574 |
TIFFFetchPerSampleAnys(TIFF* tif, TIFFDirEntry* dir, double* pl) |
1629 |
TIFFFetchPerSampleAnys(TIFF* tif, TIFFDirEntry* dir, double* pl) |
1575 |
{ |
1630 |
{ |
1576 |
uint16 samples = tif->tif_dir.td_samplesperpixel; |
1631 |
uint16 samples = tif->tif_dir.td_samplesperpixel; |
|
|
1632 |
const TIFFFieldInfo* fip; |
1577 |
int status = 0; |
1633 |
int status = 0; |
1578 |
|
1634 |
|
1579 |
if (CheckDirCount(tif, dir, (uint32) samples)) { |
1635 |
if (CheckDirCount(tif, dir, (uint32) samples)) { |
Lines 1591-1599
Link Here
|
1591 |
|
1647 |
|
1592 |
for (i = 1; i < check_count; i++) |
1648 |
for (i = 1; i < check_count; i++) |
1593 |
if (v[i] != v[0]) { |
1649 |
if (v[i] != v[0]) { |
|
|
1650 |
fip = _TIFFFieldWithTag(tif, dir->tdir_tag); |
1594 |
TIFFErrorExt(tif->tif_clientdata, tif->tif_name, |
1651 |
TIFFErrorExt(tif->tif_clientdata, tif->tif_name, |
1595 |
"Cannot handle different per-sample values for field \"%s\"", |
1652 |
"Cannot handle different per-sample values for field \"%s\"", |
1596 |
_TIFFFieldWithTag(tif, dir->tdir_tag)->field_name); |
1653 |
fip ? fip->field_name : "Unknown"); |
1597 |
goto bad; |
1654 |
goto bad; |
1598 |
} |
1655 |
} |
1599 |
*pl = v[0]; |
1656 |
*pl = v[0]; |