diff options
author | Andrey Kiselev <dron@ak4719.spb.edu> | 2006-03-03 14:13:01 +0000 |
---|---|---|
committer | Andrey Kiselev <dron@ak4719.spb.edu> | 2006-03-03 14:13:01 +0000 |
commit | 1a9877ef135cd9a64d96dc50d8f185e7e8017322 (patch) | |
tree | c5fe180a45d999e92e534cf6b5f5db371045ca18 /libtiff/tif_zip.c | |
parent | 2ed09338d9db233f9946c54b192e4e2a0f6f73dd (diff) | |
download | libtiff-git-1a9877ef135cd9a64d96dc50d8f185e7e8017322.tar.gz |
Use TIFFPredictorCleanup() in codec cleanup methods. As per bug
http://bugzilla.remotesensing.org/show_bug.cgi?id=1102
Diffstat (limited to 'libtiff/tif_zip.c')
-rw-r--r-- | libtiff/tif_zip.c | 28 |
1 files changed, 16 insertions, 12 deletions
diff --git a/libtiff/tif_zip.c b/libtiff/tif_zip.c index 7e3a10f0..c60aba41 100644 --- a/libtiff/tif_zip.c +++ b/libtiff/tif_zip.c @@ -1,4 +1,4 @@ -/* $Id: tif_zip.c,v 1.7 2005-12-21 12:23:14 joris Exp $ */ +/* $Id: tif_zip.c,v 1.8 2006-03-03 14:13:01 dron Exp $ */ /* * Copyright (c) 1995-1997 Sam Leffler @@ -249,17 +249,20 @@ static void ZIPCleanup(TIFF* tif) { ZIPState* sp = ZState(tif); - if (sp) { - if (sp->state&ZSTATE_INIT) { - /* NB: avoid problems in the library */ - if (tif->tif_mode == O_RDONLY) - inflateEnd(&sp->stream); - else - deflateEnd(&sp->stream); - } - _TIFFfree(sp); - tif->tif_data = NULL; + + assert(sp != 0); + + (void)TIFFPredictorCleanup(tif); + + if (sp->state&ZSTATE_INIT) { + /* NB: avoid problems in the library */ + if (tif->tif_mode == O_RDONLY) + inflateEnd(&sp->stream); + else + deflateEnd(&sp->stream); } + _TIFFfree(sp); + tif->tif_data = NULL; } static int @@ -311,7 +314,8 @@ TIFFInitZIP(TIFF* tif, int scheme) { ZIPState* sp; - assert( (scheme == COMPRESSION_DEFLATE) || (scheme == COMPRESSION_ADOBE_DEFLATE)); + assert( (scheme == COMPRESSION_DEFLATE) + || (scheme == COMPRESSION_ADOBE_DEFLATE)); /* * Allocate state block so tag methods have storage to record values. |