Received: by whizzer.wpd.sgi.com (921026.SGI.NOSTRIP/911001.SGI)
	 id AA19013; Tue, 19 Oct 93 13:18:29 GMT
Received: from sgi.sgi.com by whizzer.wpd.sgi.com via SMTP (921026.SGI.NOSTRIP/911001.SGI)
	for /usr/people/sam/majordomo/wrapper resend -l tiff -h sgi.sgi.com -f tiff-owner -s -m "-oi -odq -om" tiff-list id AA19006; Tue, 19 Oct 93 06:18:27 -0700
Received: from ucbvax.Berkeley.EDU by sgi.sgi.com via SMTP (920330.SGI/910110.SGI)
	for tiff-relay@whizzer.wpd.sgi.com id AA29515; Tue, 19 Oct 93 06:18:25 -0700
Received: from ben.Britain.EU.net by ucbvax.Berkeley.EDU (5.63/1.43)
	id AA13668; Tue, 19 Oct 93 06:18:20 -0700
Received: from datasci.co.uk by ben.britain.eu.net via PSS with NIFTP (PP) 
          id <sg.24209-0@ben.britain.eu.net>; Tue, 19 Oct 1993 14:18:11 +0100
From: Darren Sillett <dsillett@datasci.co.uk>
Message-Id: <1481.9310191315@systech1.datasci.co.uk>
Subject: Bug in gif2tiff
To: tiff@ucbvax.Berkeley.EDU (TIFF mailing list)
Date: Tue, 19 Oct 1993 14:15:01 +0100 (BST)
X-Mailer: ELM [version 2.4 PL22]
Content-Type: text
Content-Length: 1118
Sender: tiff-owner@sgi.sgi.com

There is a bug in the gif2tiff.c source which came to light when I was
porting the TIFF library to RISC OS.

I can't remember the exact details but the problem was that the area of
memory used for the initial gif raster image (called raster I think) was
assigned from a call to malloc and there was a corresponding call to free
to give back the memory.

Unfortunately inbetween the two calls the pointer is incremented so it doesn't
point to the start of the allocated memory any more. The fix was to copy the
value of raster into another variable, say original_raster, after allocation
and change the call to free to free(original_raster).

I can probably post the correct changes if anyone needs them but I hope the
explanation above is sufficient. The bug doesn't cause problems on most machines
as the free call is one of the last things to be actioned, however under RISC OS
it corrupted the heap which caused the program to die rather than exit
gracefully.

Darren

P.S. If anybody is interested in a RISC OS port of the TIFF library then
     please contact me as it is freely available to anyone who wants it.


