summaryrefslogtreecommitdiff
path: root/libtiff/tif_write.c
diff options
context:
space:
mode:
authorFrank Warmerdam <warmerdam@pobox.com>2003-01-31 16:43:18 +0000
committerFrank Warmerdam <warmerdam@pobox.com>2003-01-31 16:43:18 +0000
commitf6b073be96311fcc275b2209f03ce64ebbdc3069 (patch)
tree7d54e03cdd1f2c6db3e65992ca94971150ca4221 /libtiff/tif_write.c
parent42862eeefd56c27320b4dd9f5f951deb91e9acfb (diff)
downloadlibtiff-git-f6b073be96311fcc275b2209f03ce64ebbdc3069.tar.gz
Dont allow writing image data to preexisting compressed TIFF images
Diffstat (limited to 'libtiff/tif_write.c')
-rw-r--r--libtiff/tif_write.c20
1 files changed, 19 insertions, 1 deletions
diff --git a/libtiff/tif_write.c b/libtiff/tif_write.c
index 06af9960..79a80d8e 100644
--- a/libtiff/tif_write.c
+++ b/libtiff/tif_write.c
@@ -1,4 +1,4 @@
-/* $Header: /cvs/maptools/cvsroot/libtiff/libtiff/tif_write.c,v 1.7 2002-07-31 20:53:15 warmerda Exp $ */
+/* $Header: /cvs/maptools/cvsroot/libtiff/libtiff/tif_write.c,v 1.8 2003-01-31 16:43:18 warmerda Exp $ */
/*
* Copyright (c) 1988-1997 Sam Leffler
@@ -484,6 +484,24 @@ TIFFWriteCheck(TIFF* tif, int tiles, const char* module)
"Can not write scanlines to a tiled image");
return (0);
}
+
+ /*
+ * While we allow compressed TIFF files to be opened in update mode,
+ * we don't allow writing any image blocks in an existing compressed
+ * image. Eventually we could do so, by moving blocks that grow
+ * to the end of the file, but we don't for now.
+ */
+ if (tif->tif_dir.td_stripoffset != NULL
+ && tif->tif_dir.td_compression != COMPRESSION_NONE )
+ {
+ TIFFError( module,
+ "%s:\n"
+ "In place update to compressed TIFF images not "
+ "supported.",
+ tif->tif_name );
+ return (0);
+ }
+
/*
* On the first write verify all the required information
* has been setup and initialize any data structures that