]>
Commit | Line | Data |
---|---|---|
51c63957 JB |
1 | --- tiff-4.0.0/libtiff/tif_dir.c.orig 2011-02-19 17:26:09.000000000 +0100 |
2 | +++ tiff-4.0.0/libtiff/tif_dir.c 2011-12-24 10:43:18.779372638 +0100 | |
3 | @@ -153,6 +153,7 @@ _TIFFVSetField(TIFF* tif, uint32 tag, va | |
6a63362f AG |
4 | { |
5 | static const char module[] = "_TIFFVSetField"; | |
ede1b237 | 6 | |
51c63957 | 7 | + const TIFFField* fip; |
6a63362f AG |
8 | TIFFDirectory* td = &tif->tif_dir; |
9 | int status = 1; | |
10 | uint32 v32, i, v; | |
51c63957 | 11 | @@ -660,17 +661,19 @@ end: |
ede1b237 | 12 | va_end(ap); |
6a63362f AG |
13 | return (status); |
14 | badvalue: | |
51c63957 | 15 | + fip = TIFFFieldWithTag(tif, tag); |
ede1b237 | 16 | TIFFErrorExt(tif->tif_clientdata, module, |
51c63957 | 17 | "%s: Bad value %u for \"%s\" tag", |
ede1b237 | 18 | tif->tif_name, v, |
51c63957 | 19 | - TIFFFieldWithTag(tif, tag)->field_name); |
ede1b237 | 20 | + fip ? fip->field_name : "Unknown"); |
6a63362f AG |
21 | va_end(ap); |
22 | return (0); | |
23 | badvalue32: | |
51c63957 | 24 | + fip = TIFFFieldWithTag(tif, tag); |
ede1b237 JB |
25 | TIFFErrorExt(tif->tif_clientdata, module, |
26 | "%s: Bad value %u for \"%s\" tag", | |
27 | tif->tif_name, v32, | |
51c63957 | 28 | - TIFFFieldWithTag(tif, tag)->field_name); |
ede1b237 | 29 | + fip ? fip->field_name : "Unknown"); |
6a63362f AG |
30 | va_end(ap); |
31 | return (0); | |
32 | } | |
51c63957 JB |
33 | --- tiff-4.0.0/libtiff/tif_dirread.c.orig 2011-12-22 00:18:41.000000000 +0100 |
34 | +++ tiff-4.0.0/libtiff/tif_dirread.c 2011-12-24 10:39:34.932698478 +0100 | |
35 | @@ -3897,6 +3897,7 @@ TIFFReadDirectory(TIFF* tif) | |
ede1b237 | 36 | * Attempt to deal with a missing StripByteCounts tag. |
6a63362f | 37 | */ |
ede1b237 | 38 | if (!TIFFFieldSet(tif, FIELD_STRIPBYTECOUNTS)) { |
51c63957 | 39 | + const TIFFField* fip = TIFFFieldWithTag(tif, TIFFTAG_STRIPBYTECOUNTS); |
ede1b237 JB |
40 | /* |
41 | * Some manufacturers violate the spec by not giving | |
42 | * the size of the strips. In this case, assume there | |
51c63957 JB |
43 | @@ -3912,7 +3913,7 @@ TIFFReadDirectory(TIFF* tif) |
44 | TIFFWarningExt(tif->tif_clientdata, module, | |
45 | "TIFF directory is missing required " | |
ede1b237 | 46 | "\"%s\" field, calculating from imagelength", |
51c63957 | 47 | - TIFFFieldWithTag(tif,TIFFTAG_STRIPBYTECOUNTS)->field_name); |
ede1b237 JB |
48 | + fip ? fip->field_name : "Unknown"); |
49 | if (EstimateStripByteCounts(tif, dir, dircount) < 0) | |
50 | goto bad; | |
6a63362f | 51 | /* |
51c63957 JB |
52 | @@ -3940,6 +3941,7 @@ TIFFReadDirectory(TIFF* tif) |
53 | && _TIFFFillStriles(tif) | |
54 | && tif->tif_dir.td_stripoffset[0] != 0 | |
ede1b237 | 55 | && BYTECOUNTLOOKSBAD) { |
51c63957 | 56 | + const TIFFField* fip = TIFFFieldWithTag(tif, TIFFTAG_STRIPBYTECOUNTS); |
ede1b237 JB |
57 | /* |
58 | * XXX: Plexus (and others) sometimes give a value of | |
59 | * zero for a tag when they don't know what the | |
51c63957 JB |
60 | @@ -3948,7 +3950,7 @@ TIFFReadDirectory(TIFF* tif) |
61 | */ | |
ede1b237 | 62 | TIFFWarningExt(tif->tif_clientdata, module, |
51c63957 JB |
63 | "Bogus \"%s\" field, ignoring and calculating from imagelength", |
64 | - TIFFFieldWithTag(tif,TIFFTAG_STRIPBYTECOUNTS)->field_name); | |
65 | + fip ? fip->field_name : "Unknown"); | |
ede1b237 JB |
66 | if(EstimateStripByteCounts(tif, dir, dircount) < 0) |
67 | goto bad; | |
51c63957 JB |
68 | |
69 | @@ -3959,6 +3961,7 @@ TIFFReadDirectory(TIFF* tif) | |
70 | && tif->tif_dir.td_stripbytecount[0] != tif->tif_dir.td_stripbytecount[1] | |
71 | && tif->tif_dir.td_stripbytecount[0] != 0 | |
72 | && tif->tif_dir.td_stripbytecount[1] != 0 ) { | |
73 | + const TIFFField* fip = TIFFFieldWithTag(tif, TIFFTAG_STRIPBYTECOUNTS); | |
ede1b237 | 74 | /* |
51c63957 JB |
75 | * XXX: Some vendors fill StripByteCount array with |
76 | * absolutely wrong values (it can be equal to | |
77 | @@ -3971,7 +3974,7 @@ TIFFReadDirectory(TIFF* tif) | |
78 | */ | |
ede1b237 | 79 | TIFFWarningExt(tif->tif_clientdata, module, |
51c63957 JB |
80 | "Wrong \"%s\" field, ignoring and calculating from imagelength", |
81 | - TIFFFieldWithTag(tif,TIFFTAG_STRIPBYTECOUNTS)->field_name); | |
82 | + fip ? fip->field_name : "Unknown"); | |
ede1b237 JB |
83 | if (EstimateStripByteCounts(tif, dir, dircount) < 0) |
84 | goto bad; | |
51c63957 | 85 | #endif /* !defined(DEFER_STRILE_LOAD) */ |