Received: from mailgate006.isp.belgacom.be (mailgate006.isp.belgacom.be [195.238.5.212])
	by maildelivery011.isp.belgacom.be (Postfix) with ESMTP id 4387959800D
	for <joris.at.lebbeke@skynet.be>; Thu, 22 Nov 2007 09:33:37 +0100 (CET)
Received: from r153.dmsolutions.ca (HELO duke.maptools.org) ([209.217.116.153])
  by in.mx.skynet.be with ESMTP; 22 Nov 2007 09:33:21 +0100
Received: from duke.maptools.org (duke.maptools.org [127.0.0.1])
	by duke.maptools.org (8.12.11/8.12.10) with ESMTP id lAM86R2J030499;
	Thu, 22 Nov 2007 03:07:33 -0500
Received: from outbound8-sin-R.bigfish.com (outbound-sin.frontbridge.com
	[207.46.51.80])
	by duke.maptools.org (8.12.11/8.12.10) with ESMTP id lAM86DAB030496
	for <tiff@lists.maptools.org>; Thu, 22 Nov 2007 03:06:13 -0500
Received: from outbound8-sin.bigfish.com (localhost.localdomain [127.0.0.1])
	by outbound8-sin-R.bigfish.com (Postfix) with ESMTP id 958A918D9980;
	Thu, 22 Nov 2007 08:05:30 +0000 (UTC)
Received: from mail128-sin-R.bigfish.com (unknown [10.3.40.3])
	by outbound8-sin.bigfish.com (Postfix) with ESMTP id 80B364E804F;
	Thu, 22 Nov 2007 08:05:30 +0000 (UTC)
Received: from mail128-sin (localhost.localdomain [127.0.0.1])
	by mail128-sin-R.bigfish.com (Postfix) with ESMTP id 78283FF80A4;
	Thu, 22 Nov 2007 08:05:24 +0000 (UTC)
X-BigFish: VP
X-MS-Exchange-Organization-Antispam-Report: OrigIP: 195.35.232.6;Service: EHS
Received: by mail128-sin (MessageSwitch) id 1195718724208043_24881;
	Thu, 22 Nov 2007 08:05:24 +0000 (UCT)
Received: from smtp.oce.com (cp-mail010.oce.com [195.35.232.6])
	(using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))
	(No client certificate requested)
	by mail128-sin.bigfish.com (Postfix) with ESMTP id 79969150005E;
	Thu, 22 Nov 2007 08:05:23 +0000 (UTC)
Received: from oce-exbhcs01a.oce.net by smtp.oce.com id lAM85vGM005872
Received: from oce-exbh01.oce.net ([10.99.4.106]) by oce-exbhcs01a.oce.net
	with Microsoft SMTPSVC(6.0.3790.3959); 
	Thu, 22 Nov 2007 09:05:18 +0100
Received: from OVL-EXBE01.ocevenlo.oce.net ([134.188.143.21]) by
	oce-exbh01.oce.net with Microsoft SMTPSVC(6.0.3790.3959); 
	Thu, 22 Nov 2007 09:05:18 +0100
X-MimeOLE: Produced By Microsoft Exchange V6.5
Content-class: urn:content-classes:message
MIME-Version: 1.0
Content-Type: text/plain;
	charset="us-ascii"
Subject: RE: [Tiff] tag content size limit?
Date: Thu, 22 Nov 2007 09:05:17 +0100
Message-ID: <C2F34B4088C6514E86F06DA928A2D21802A127CF@OVL-EXBE01.ocevenlo.oce.net>
In-Reply-To: <47447E82.4050600@pobox.com>
X-MS-Has-Attach: 
X-MS-TNEF-Correlator: 
Thread-Topic: [Tiff] tag content size limit?
Thread-Index: AcgscKVl+j8TJm1wQzSlfZHtpYtLNwAY10OQ
References: <47447E82.4050600@pobox.com>
From: "Tillaart, Rob van den" <rob.vandentillaart@oce.com>
To: "Frank Warmerdam" <warmerdam@pobox.com>,
        "TIFF mailing list" <tiff@lists.maptools.org>
X-OriginalArrivalTime: 22 Nov 2007 08:05:18.0174 (UTC)
	FILETIME=[6BB97FE0:01C82CDE]
X-MIME-Autoconverted: from quoted-printable to 8bit by duke.maptools.org id
	lAM86DAB030496
Cc: 
X-BeenThere: tiff@lists.maptools.org
X-Mailman-Version: 2.1.4
Precedence: list
List-Id: TIFF and libtiff discussion <tiff.lists.maptools.org>
List-Unsubscribe: <http://lists.maptools.org/mailman/listinfo/tiff>,
	<mailto:tiff-request@lists.maptools.org?subject=unsubscribe>
List-Archive: <http://lists.maptools.org/mailman/private/tiff>
List-Post: <mailto:tiff@lists.maptools.org>
List-Help: <mailto:tiff-request@lists.maptools.org?subject=help>
List-Subscribe: <http://lists.maptools.org/mailman/listinfo/tiff>,
	<mailto:tiff-request@lists.maptools.org?subject=subscribe>
Sender: tiff-bounces@lists.maptools.org
Errors-To: tiff-bounces@lists.maptools.org
Content-Transfer-Encoding: quoted-printable
X-UIDL: 000000000023ceae.000028f8
X-MSP-STORE: Thu, 22 Nov 2007 09:33:37 +0100
Status:   


Hi,

If I understand correctly the code lines you refering to are about the
number of Directory Entries in an IFD. As far as I know this count is
not related to the number of strips.=20

Or could it be some unwanted sideeffect? overflow or overwritten memory
buffer? Does the value of tdir_count make sense?


>From the point of strip administration I see the following logical
restrictions:

	1 <=3D StripByteCounts <=3D RowsPerStrip * ImageWidth

	1 <=3D # RowsPerStrip <=3D ImageLength
	recommendation each strip is about 8K (6.0 spec page 39) but=20
	that seems to me a historical practical buffersize.

	1 <=3D # StripOffsets < FileSize/StripByteCounts=20

Furthermore all offsets should comply to=20

	TiffHeadersize < offset < filesize

Conclusion no reason for some 4MB limit,

sofar my 2 cents,
rob tillaart








> -----Original Message-----
> From: tiff-bounces@lists.maptools.org=20
> [mailto:tiff-bounces@lists.maptools.org] On Behalf Of Frank Warmerdam
> Sent: woensdag 21 november 2007 19:53
> To: TIFF mailing list
> Subject: [Tiff] tag content size limit?
>=20
> Joris,
>=20
> I have run into problems with my attempts to create a TIFF file with
> 1333333 strips.  Attempts to read the the stripoffsets tag=20
> results in an error in TIFFReadDirEntryErr() with this logic:
>=20
> 	if ((uint64)(4*1024*1024/typesize)<direntry->tdir_count)
> 		return(TIFFReadDirEntryErrSizesan);
> 	if ((uint64)(4*1024*1024/desttypesize)<direntry->tdir_count)
> 		return(TIFFReadDirEntryErrSizesan);
>=20
> The logic seems to assume that any tag contents larger than=20
> 4MB likely implies a corrupt file.  Is there a particular=20
> reason we should put in place such a restriction?  Should the=20
> restriction be removed?  Relaxed?
> (perhaps upped to any tag value larger than 1GB is likely=20
> corruption?  or any tag value larger than the file itself is?
>=20
> Best regards,
> --=20
> ---------------------------------------+----------------------
> ----------
> ---------------------------------------+------
> I set the clouds in motion - turn up   | Frank Warmerdam,=20
> warmerdam@pobox.com
> light and sound - activate the windows | http://pobox.com/~warmerdam
> and watch the world go round - Rush    | President OSGeo,=20
> http://osgeo.org
>=20
> _______________________________________________
> Tiff mailing list: Tiff@lists.maptools.org=20
> http://lists.maptools.org/mailman/listinfo/tiff
> http://www.remotesensing.org/libtiff/
>=20
>=20

This message and attachment(s) are intended solely for use by the address=
ee and may contain information that is privileged, confidential or otherw=
ise exempt from disclosure under applicable law.

If you are not the intended recipient or agent thereof responsible for de=
livering this message to the intended recipient, you are hereby notified =
that any dissemination, distribution or copying of this communication is =
strictly prohibited.

If you have received this communication in error, please notify the sende=
r immediately by telephone and with a 'reply' message.
 =20
Thank you for your co-operation.



_______________________________________________
Tiff mailing list: Tiff@lists.maptools.org
http://lists.maptools.org/mailman/listinfo/tiff
http://www.remotesensing.org/libtiff/
