fixed problem copying overlapping buffers in TIFFReadRGBATile()

This commit is contained in:
Frank Warmerdam 2001-08-11 03:41:07 +00:00
parent 7f12712234
commit 7afe0a69bc
2 changed files with 11 additions and 5 deletions

View File

@ -1,5 +1,11 @@
2001-08-10 Frank Warmerdam <warmerdam@pobox.com>
* libtiff/tif_getimage.c: Use memmove() instead of TIFFmemcpy()
in TIFFReadRGBATile() to avoid issues in cases of overlapping
buffers. See Bug 69 in Bugzilla.
http://bugzilla.remotesensing.org/show_bug.cgi?id=69
* tools/tiff2rgba.c: fixed getopt() call so that -b works again.
2001-08-09 Frank Warmerdam <warmerdam@pobox.com>

View File

@ -1,4 +1,4 @@
/* $Header: /cvs/maptools/cvsroot/libtiff/libtiff/tif_getimage.c,v 1.10 2001-07-18 13:27:35 warmerda Exp $ */
/* $Header: /cvs/maptools/cvsroot/libtiff/libtiff/tif_getimage.c,v 1.11 2001-08-11 03:41:07 warmerda Exp $ */
/*
* Copyright (c) 1991-1997 Sam Leffler
@ -2345,9 +2345,9 @@ TIFFReadRGBATile(TIFF* tif, uint32 col, uint32 row, uint32 * raster)
for( i_row = 0; i_row < read_ysize; i_row++ )
{
_TIFFmemcpy( raster + (tile_ysize - i_row - 1) * tile_xsize,
raster + (read_ysize - i_row - 1) * read_xsize,
read_xsize * sizeof(uint32) );
memmove( raster + (tile_ysize - i_row - 1) * tile_xsize,
raster + (read_ysize - i_row - 1) * read_xsize,
read_xsize * sizeof(uint32) );
_TIFFmemset( raster + (tile_ysize - i_row - 1) * tile_xsize+read_xsize,
0, sizeof(uint32) * (tile_xsize - read_xsize) );
}
@ -2357,6 +2357,6 @@ TIFFReadRGBATile(TIFF* tif, uint32 col, uint32 row, uint32 * raster)
_TIFFmemset( raster + (tile_ysize - i_row - 1) * tile_xsize,
0, sizeof(uint32) * tile_xsize );
}
return (ok);
}