summaryrefslogtreecommitdiff
path: root/libtiff/tif_pixarlog.c
diff options
context:
space:
mode:
authorAndrey Kiselev <dron@ak4719.spb.edu>2006-03-03 14:13:01 +0000
committerAndrey Kiselev <dron@ak4719.spb.edu>2006-03-03 14:13:01 +0000
commit1a9877ef135cd9a64d96dc50d8f185e7e8017322 (patch)
treec5fe180a45d999e92e534cf6b5f5db371045ca18 /libtiff/tif_pixarlog.c
parent2ed09338d9db233f9946c54b192e4e2a0f6f73dd (diff)
downloadlibtiff-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_pixarlog.c')
-rw-r--r--libtiff/tif_pixarlog.c41
1 files changed, 22 insertions, 19 deletions
diff --git a/libtiff/tif_pixarlog.c b/libtiff/tif_pixarlog.c
index f3a873fc..80022b2e 100644
--- a/libtiff/tif_pixarlog.c
+++ b/libtiff/tif_pixarlog.c
@@ -1,4 +1,4 @@
-/* $Id: tif_pixarlog.c,v 1.11 2005-12-21 12:23:13 joris Exp $ */
+/* $Id: tif_pixarlog.c,v 1.12 2006-03-03 14:13:01 dron Exp $ */
/*
* Copyright (c) 1996-1997 Sam Leffler
@@ -1163,24 +1163,26 @@ PixarLogCleanup(TIFF* tif)
{
PixarLogState* sp = (PixarLogState*) tif->tif_data;
- if (sp) {
- if (sp->FromLT2) _TIFFfree(sp->FromLT2);
- if (sp->From14) _TIFFfree(sp->From14);
- if (sp->From8) _TIFFfree(sp->From8);
- if (sp->ToLinearF) _TIFFfree(sp->ToLinearF);
- if (sp->ToLinear16) _TIFFfree(sp->ToLinear16);
- if (sp->ToLinear8) _TIFFfree(sp->ToLinear8);
- if (sp->state&PLSTATE_INIT) {
- if (tif->tif_mode == O_RDONLY)
- inflateEnd(&sp->stream);
- else
- deflateEnd(&sp->stream);
- }
- if (sp->tbuf)
- _TIFFfree(sp->tbuf);
- _TIFFfree(sp);
- tif->tif_data = NULL;
+ assert(sp != 0);
+
+ (void)TIFFPredictorCleanup(tif);
+
+ if (sp->FromLT2) _TIFFfree(sp->FromLT2);
+ if (sp->From14) _TIFFfree(sp->From14);
+ if (sp->From8) _TIFFfree(sp->From8);
+ if (sp->ToLinearF) _TIFFfree(sp->ToLinearF);
+ if (sp->ToLinear16) _TIFFfree(sp->ToLinear16);
+ if (sp->ToLinear8) _TIFFfree(sp->ToLinear8);
+ if (sp->state&PLSTATE_INIT) {
+ if (tif->tif_mode == O_RDONLY)
+ inflateEnd(&sp->stream);
+ else
+ deflateEnd(&sp->stream);
}
+ if (sp->tbuf)
+ _TIFFfree(sp->tbuf);
+ _TIFFfree(sp);
+ tif->tif_data = NULL;
}
static int
@@ -1326,7 +1328,8 @@ TIFFInitPixarLog(TIFF* tif, int scheme)
return (1);
bad:
- TIFFErrorExt(tif->tif_clientdata, "TIFFInitPixarLog", "No space for PixarLog state block");
+ TIFFErrorExt(tif->tif_clientdata, "TIFFInitPixarLog",
+ "No space for PixarLog state block");
return (0);
}
#endif /* PIXARLOG_SUPPORT */