Skip to content

Commit 5c709f4

Browse files
committed
3rdparty: update libtiff 4.0.9
1 parent ae5e1f8 commit 5c709f4

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

53 files changed

+27453
-24426
lines changed

3rdparty/libtiff/CMakeLists.txt

Lines changed: 360 additions & 12 deletions
Large diffs are not rendered by default.

3rdparty/libtiff/tif_aux.c

Lines changed: 263 additions & 245 deletions
Large diffs are not rendered by default.

3rdparty/libtiff/tif_close.c

Lines changed: 50 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,26 @@
1-
/* $Id: tif_close.c,v 1.19 2010-03-10 18:56:48 bfriesen Exp $ */
1+
/* $Id: tif_close.c,v 1.21 2016-01-23 21:20:34 erouault Exp $ */
22

33
/*
44
* Copyright (c) 1988-1997 Sam Leffler
55
* Copyright (c) 1991-1997 Silicon Graphics, Inc.
66
*
7-
* Permission to use, copy, modify, distribute, and sell this software and
7+
* Permission to use, copy, modify, distribute, and sell this software and
88
* its documentation for any purpose is hereby granted without fee, provided
99
* that (i) the above copyright notices and this permission notice appear in
1010
* all copies of the software and related documentation, and (ii) the names of
1111
* Sam Leffler and Silicon Graphics may not be used in any advertising or
1212
* publicity relating to the software without the specific, prior written
1313
* permission of Sam Leffler and Silicon Graphics.
14-
*
15-
* THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND,
16-
* EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY
17-
* WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
18-
*
14+
*
15+
* THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND,
16+
* EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY
17+
* WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
18+
*
1919
* IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR
2020
* ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND,
2121
* OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
22-
* WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF
23-
* LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
22+
* WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF
23+
* LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
2424
* OF THIS SOFTWARE.
2525
*/
2626

@@ -36,61 +36,61 @@
3636

3737
/**
3838
* Auxiliary function to free the TIFF structure. Given structure will be
39-
* completetly freed, so you should save opened file handle and pointer
39+
* completely freed, so you should save opened file handle and pointer
4040
* to the close procedure in external variables before calling
4141
* _TIFFCleanup(), if you will need these ones to close the file.
42-
*
42+
*
4343
* @param tif A TIFF pointer.
4444
*/
4545

4646
void
4747
TIFFCleanup(TIFF* tif)
4848
{
49-
/*
49+
/*
5050
* Flush buffered data and directory (if dirty).
5151
*/
52-
if (tif->tif_mode != O_RDONLY)
53-
TIFFFlush(tif);
54-
(*tif->tif_cleanup)(tif);
55-
TIFFFreeDirectory(tif);
52+
if (tif->tif_mode != O_RDONLY)
53+
TIFFFlush(tif);
54+
(*tif->tif_cleanup)(tif);
55+
TIFFFreeDirectory(tif);
5656

57-
if (tif->tif_dirlist)
58-
_TIFFfree(tif->tif_dirlist);
57+
if (tif->tif_dirlist)
58+
_TIFFfree(tif->tif_dirlist);
5959

60-
/*
60+
/*
6161
* Clean up client info links.
6262
*/
63-
while( tif->tif_clientinfo )
64-
{
65-
TIFFClientInfoLink *link = tif->tif_clientinfo;
63+
while( tif->tif_clientinfo )
64+
{
65+
TIFFClientInfoLink *psLink = tif->tif_clientinfo;
6666

67-
tif->tif_clientinfo = link->next;
68-
_TIFFfree( link->name );
69-
_TIFFfree( link );
70-
}
67+
tif->tif_clientinfo = psLink->next;
68+
_TIFFfree( psLink->name );
69+
_TIFFfree( psLink );
70+
}
7171

72-
if (tif->tif_rawdata && (tif->tif_flags&TIFF_MYBUFFER))
73-
_TIFFfree(tif->tif_rawdata);
74-
if (isMapped(tif))
75-
TIFFUnmapFileContents(tif, tif->tif_base, (toff_t)tif->tif_size);
72+
if (tif->tif_rawdata && (tif->tif_flags&TIFF_MYBUFFER))
73+
_TIFFfree(tif->tif_rawdata);
74+
if (isMapped(tif))
75+
TIFFUnmapFileContents(tif, tif->tif_base, (toff_t)tif->tif_size);
7676

77-
/*
77+
/*
7878
* Clean up custom fields.
7979
*/
80-
if (tif->tif_fields && tif->tif_nfields > 0) {
81-
uint32 i;
82-
83-
for (i = 0; i < tif->tif_nfields; i++) {
84-
TIFFField *fld = tif->tif_fields[i];
85-
if (fld->field_bit == FIELD_CUSTOM &&
86-
strncmp("Tag ", fld->field_name, 4) == 0) {
87-
_TIFFfree(fld->field_name);
88-
_TIFFfree(fld);
89-
}
90-
}
80+
if (tif->tif_fields && tif->tif_nfields > 0) {
81+
uint32 i;
82+
83+
for (i = 0; i < tif->tif_nfields; i++) {
84+
TIFFField *fld = tif->tif_fields[i];
85+
if (fld->field_bit == FIELD_CUSTOM &&
86+
strncmp("Tag ", fld->field_name, 4) == 0) {
87+
_TIFFfree(fld->field_name);
88+
_TIFFfree(fld);
89+
}
90+
}
9191

92-
_TIFFfree(tif->tif_fields);
93-
}
92+
_TIFFfree(tif->tif_fields);
93+
}
9494

9595
if (tif->tif_nfieldscompat > 0) {
9696
uint32 i;
@@ -102,7 +102,7 @@ TIFFCleanup(TIFF* tif)
102102
_TIFFfree(tif->tif_fieldscompat);
103103
}
104104

105-
_TIFFfree(tif);
105+
_TIFFfree(tif);
106106
}
107107

108108
/************************************************************************/
@@ -115,18 +115,18 @@ TIFFCleanup(TIFF* tif)
115115
* TIFFClose closes a file that was previously opened with TIFFOpen().
116116
* Any buffered data are flushed to the file, including the contents of
117117
* the current directory (if modified); and all resources are reclaimed.
118-
*
118+
*
119119
* @param tif A TIFF pointer.
120120
*/
121121

122122
void
123123
TIFFClose(TIFF* tif)
124124
{
125-
TIFFCloseProc closeproc = tif->tif_closeproc;
126-
thandle_t fd = tif->tif_clientdata;
125+
TIFFCloseProc closeproc = tif->tif_closeproc;
126+
thandle_t fd = tif->tif_clientdata;
127127

128-
TIFFCleanup(tif);
129-
(void) (*closeproc)(fd);
128+
TIFFCleanup(tif);
129+
(void) (*closeproc)(fd);
130130
}
131131

132132
/* vim: set ts=8 sts=8 sw=8 noet: */

3rdparty/libtiff/tif_codec.c

Lines changed: 34 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,26 @@
1-
/* $Id: tif_codec.c,v 1.15 2010-12-14 12:53:00 dron Exp $ */
1+
/* $Id: tif_codec.c,v 1.17 2015-08-19 02:31:04 bfriesen Exp $ */
22

33
/*
44
* Copyright (c) 1988-1997 Sam Leffler
55
* Copyright (c) 1991-1997 Silicon Graphics, Inc.
66
*
7-
* Permission to use, copy, modify, distribute, and sell this software and
7+
* Permission to use, copy, modify, distribute, and sell this software and
88
* its documentation for any purpose is hereby granted without fee, provided
99
* that (i) the above copyright notices and this permission notice appear in
1010
* all copies of the software and related documentation, and (ii) the names of
1111
* Sam Leffler and Silicon Graphics may not be used in any advertising or
1212
* publicity relating to the software without the specific, prior written
1313
* permission of Sam Leffler and Silicon Graphics.
14-
*
15-
* THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND,
16-
* EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY
17-
* WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
18-
*
14+
*
15+
* THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND,
16+
* EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY
17+
* WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
18+
*
1919
* IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR
2020
* ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND,
2121
* OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
22-
* WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF
23-
* LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
22+
* WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF
23+
* LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
2424
* OF THIS SOFTWARE.
2525
*/
2626

@@ -94,7 +94,7 @@ TIFFCodec _TIFFBuiltinCODECS[] = {
9494
{ "CCITT Group 4", COMPRESSION_CCITTFAX4, TIFFInitCCITTFax4 },
9595
{ "ISO JBIG", COMPRESSION_JBIG, TIFFInitJBIG },
9696
{ "Deflate", COMPRESSION_DEFLATE, TIFFInitZIP },
97-
{ "AdobeDeflate", COMPRESSION_ADOBE_DEFLATE , TIFFInitZIP },
97+
{ "AdobeDeflate", COMPRESSION_ADOBE_DEFLATE , TIFFInitZIP },
9898
{ "PixarLog", COMPRESSION_PIXARLOG, TIFFInitPixarLog },
9999
{ "SGILog", COMPRESSION_SGILOG, TIFFInitSGILog },
100100
{ "SGILog24", COMPRESSION_SGILOG24, TIFFInitSGILog },
@@ -105,27 +105,27 @@ TIFFCodec _TIFFBuiltinCODECS[] = {
105105
static int
106106
_notConfigured(TIFF* tif)
107107
{
108-
const TIFFCodec* c = TIFFFindCODEC(tif->tif_dir.td_compression);
108+
const TIFFCodec* c = TIFFFindCODEC(tif->tif_dir.td_compression);
109109
char compression_code[20];
110-
111-
sprintf( compression_code, "%d", tif->tif_dir.td_compression );
112-
TIFFErrorExt(tif->tif_clientdata, tif->tif_name,
113-
"%s compression support is not configured",
110+
111+
sprintf(compression_code, "%d",tif->tif_dir.td_compression );
112+
TIFFErrorExt(tif->tif_clientdata, tif->tif_name,
113+
"%s compression support is not configured",
114114
c ? c->name : compression_code );
115-
return (0);
115+
return (0);
116116
}
117117

118118
static int
119119
NotConfigured(TIFF* tif, int scheme)
120120
{
121-
(void) scheme;
121+
(void) scheme;
122122

123-
tif->tif_fixuptags = _notConfigured;
124-
tif->tif_decodestatus = FALSE;
125-
tif->tif_setupdecode = _notConfigured;
126-
tif->tif_encodestatus = FALSE;
127-
tif->tif_setupencode = _notConfigured;
128-
return (1);
123+
tif->tif_fixuptags = _notConfigured;
124+
tif->tif_decodestatus = FALSE;
125+
tif->tif_setupdecode = _notConfigured;
126+
tif->tif_encodestatus = FALSE;
127+
tif->tif_setupencode = _notConfigured;
128+
return (1);
129129
}
130130

131131
/************************************************************************/
@@ -142,18 +142,18 @@ NotConfigured(TIFF* tif, int scheme)
142142
int
143143
TIFFIsCODECConfigured(uint16 scheme)
144144
{
145-
const TIFFCodec* codec = TIFFFindCODEC(scheme);
145+
const TIFFCodec* codec = TIFFFindCODEC(scheme);
146146

147-
if(codec == NULL) {
148-
return 0;
149-
}
150-
if(codec->init == NULL) {
151-
return 0;
152-
}
153-
if(codec->init != NotConfigured){
154-
return 1;
155-
}
156-
return 0;
147+
if(codec == NULL) {
148+
return 0;
149+
}
150+
if(codec->init == NULL) {
151+
return 0;
152+
}
153+
if(codec->init != NotConfigured){
154+
return 1;
155+
}
156+
return 0;
157157
}
158158

159159
/*

0 commit comments

Comments
 (0)