diff options
author | Liang Qi <liang.qi@digia.com> | 2013-03-04 10:22:52 +0100 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-04-05 11:07:49 +0200 |
commit | 8b2b1b0f63d258ec5ea753cd44531731c0bdece8 (patch) | |
tree | 2c651bf7ba4d34ff8314d180eec11c7a7c3bbd52 /src/3rdparty/libtiff/libtiff/tif_close.c | |
parent | 7a10649ea7b8963d66c14a0391b7356fc7d9ce9d (diff) |
Upgrading libtiff: Adding clean copy of libtiff 4.0.3
This commit removes the previous version of the bundled libtiff
(3.9.2), as well as all local modifications to it. It adds an
unmodified copy of the official libtiff source distribution, except
that various extraneous files have been removed, as usual.
The patches required to build it in Qt will follow in separate
commit(s).
Task-number: QTBUG-25409
Change-Id: If47e02c25ce1a2b3b47eff94a875e2abea0c7e1c
Reviewed-by: aavit <eirik.aavitsland@digia.com>
Diffstat (limited to 'src/3rdparty/libtiff/libtiff/tif_close.c')
-rw-r--r-- | src/3rdparty/libtiff/libtiff/tif_close.c | 69 |
1 files changed, 45 insertions, 24 deletions
diff --git a/src/3rdparty/libtiff/libtiff/tif_close.c b/src/3rdparty/libtiff/libtiff/tif_close.c index 3623277..13d2bab 100644 --- a/src/3rdparty/libtiff/libtiff/tif_close.c +++ b/src/3rdparty/libtiff/libtiff/tif_close.c @@ -1,4 +1,4 @@ -/* $Id: tif_close.c,v 1.10 2006/03/25 03:09:24 joris Exp $ */ +/* $Id: tif_close.c,v 1.19 2010-03-10 18:56:48 bfriesen Exp $ */ /* * Copyright (c) 1988-1997 Sam Leffler @@ -28,6 +28,7 @@ * TIFF Library. */ #include "tiffiop.h" +#include <string.h> /************************************************************************/ /* TIFFCleanup() */ @@ -45,18 +46,20 @@ void TIFFCleanup(TIFF* tif) { + /* + * Flush buffered data and directory (if dirty). + */ if (tif->tif_mode != O_RDONLY) - /* - * Flush buffered data and directory (if dirty). - */ - TIFFFlush(tif); + TIFFFlush(tif); (*tif->tif_cleanup)(tif); TIFFFreeDirectory(tif); if (tif->tif_dirlist) _TIFFfree(tif->tif_dirlist); - /* Clean up client info links */ + /* + * Clean up client info links. + */ while( tif->tif_clientinfo ) { TIFFClientInfoLink *link = tif->tif_clientinfo; @@ -69,27 +72,36 @@ TIFFCleanup(TIFF* tif) if (tif->tif_rawdata && (tif->tif_flags&TIFF_MYBUFFER)) _TIFFfree(tif->tif_rawdata); if (isMapped(tif)) - TIFFUnmapFileContents(tif, tif->tif_base, tif->tif_size); - - /* Clean up custom fields */ - if (tif->tif_nfields > 0) - { - size_t i; - - for (i = 0; i < tif->tif_nfields; i++) - { - TIFFFieldInfo *fld = tif->tif_fieldinfo[i]; - if (fld->field_bit == FIELD_CUSTOM && - strncmp("Tag ", fld->field_name, 4) == 0) - { - _TIFFfree(fld->field_name); - _TIFFfree(fld); + TIFFUnmapFileContents(tif, tif->tif_base, (toff_t)tif->tif_size); + + /* + * Clean up custom fields. + */ + if (tif->tif_fields && tif->tif_nfields > 0) { + uint32 i; + + for (i = 0; i < tif->tif_nfields; i++) { + TIFFField *fld = tif->tif_fields[i]; + if (fld->field_bit == FIELD_CUSTOM && + strncmp("Tag ", fld->field_name, 4) == 0) { + _TIFFfree(fld->field_name); + _TIFFfree(fld); + } } - } - - _TIFFfree(tif->tif_fieldinfo); + + _TIFFfree(tif->tif_fields); } + if (tif->tif_nfieldscompat > 0) { + uint32 i; + + for (i = 0; i < tif->tif_nfieldscompat; i++) { + if (tif->tif_fieldscompat[i].allocated_size) + _TIFFfree(tif->tif_fieldscompat[i].fields); + } + _TIFFfree(tif->tif_fieldscompat); + } + _TIFFfree(tif); } @@ -117,3 +129,12 @@ TIFFClose(TIFF* tif) (void) (*closeproc)(fd); } +/* vim: set ts=8 sts=8 sw=8 noet: */ + +/* + * Local Variables: + * mode: c + * c-basic-offset: 8 + * fill-column: 78 + * End: + */ |