summaryrefslogtreecommitdiff
path: root/libtiff/tif_strip.c
diff options
context:
space:
mode:
authorAndrey Kiselev <dron@ak4719.spb.edu>2004-10-02 11:16:04 +0000
committerAndrey Kiselev <dron@ak4719.spb.edu>2004-10-02 11:16:04 +0000
commit2a85ad222cfd53562151318e2779c0a25320a4e1 (patch)
tree7be0c1f0fc0f020c30a2ac4cf19eb3cb41930684 /libtiff/tif_strip.c
parentebae7b75f62976c4faccff978b934602d53548e4 (diff)
downloadlibtiff-git-2a85ad222cfd53562151318e2779c0a25320a4e1.tar.gz
*** empty log message ***
Diffstat (limited to 'libtiff/tif_strip.c')
-rw-r--r--libtiff/tif_strip.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/libtiff/tif_strip.c b/libtiff/tif_strip.c
index 5df682d3..ec6f5382 100644
--- a/libtiff/tif_strip.c
+++ b/libtiff/tif_strip.c
@@ -1,4 +1,4 @@
-/* $Id: tif_strip.c,v 1.11 2004-10-01 14:11:01 dron Exp $ */
+/* $Id: tif_strip.c,v 1.12 2004-10-02 11:16:27 dron Exp $ */
/*
* Copyright (c) 1991-1997 Sam Leffler
@@ -34,7 +34,11 @@
static uint32
summarize(TIFF* tif, size_t summand1, size_t summand2, const char* where)
{
- size_t bytes = summand1 + summand2;
+ /*
+ * XXX: We are using casting to uint32 here, bacause sizeof(size_t)
+ * may be larger than sizeof(uint32) on 64-bit architectures.
+ */
+ uint32 bytes = summand1 + summand2;
if (bytes - summand1 != summand2) {
TIFFError(tif->tif_name, "Integer overflow in %s", where);
@@ -47,7 +51,7 @@ summarize(TIFF* tif, size_t summand1, size_t summand2, const char* where)
static uint32
multiply(TIFF* tif, size_t nmemb, size_t elem_size, const char* where)
{
- size_t bytes = nmemb * elem_size;
+ uint32 bytes = nmemb * elem_size;
if (elem_size && bytes / elem_size != nmemb) {
TIFFError(tif->tif_name, "Integer overflow in %s", where);