| AWARE [SYSTEMS] | Imaging expertise for the Delphi developer | |||||||
![]() |
TIFF and LibTiff Mailing List Archive | |||||||
LibTiff Mailing List
TIFF and LibTiff Mailing List Archive Contact
The TIFF Mailing List Homepage |
Thread2004.10.17 16:47 "Re: WIN32 _TIFFrealloc() bug?", by Larry GrillHi,
I thought this one was fixed in the general release some time ago. If you
search the message archive you should find the same topic from me, but if
you change the TIFFrealloc method this way, it will be fine. This is
corrected in the 3.7 release.
tdata_t
_TIFFrealloc(tdata_t p, tsize_t s)
{
void* pvTmp;
tsize_t old;
if(p==NULL)
return ((tdata_t)GlobalAlloc(GMEM_FIXED, s));
old = GlobalSize(p);
if (old>=s)
{
if ((pvTmp = GlobalAlloc(GMEM_FIXED, s)) != NULL) {
CopyMemory(pvTmp, p, s);
GlobalFree(p);
}
}
else
{
if ((pvTmp = GlobalAlloc(GMEM_FIXED, s)) != NULL) {
CopyMemory(pvTmp, p, old);
GlobalFree(p);
}
}
return ((tdata_t)pvTmp);
}
Larry M. Grill
larry@nuglyphix.com
www.nuglyphix.com
|
|||||||