Opened 12 years ago
Closed 12 years ago
#4090 closed defect (fixed)
[PATCH] Off-by-one error in GDALReplicateWord
|Reported by:||bclaywell||Owned by:||Even Rouault|
(This bug was observed in 1.8.0, but the relevant code in trunk appears unchanged.)
When attempting to expand the canvas of an image with a non-zero nodata value (1, in this case) we noticed that the rightmost column of the image was still zero. Inspection of the GByte packed buffer case in GDALReplicateWord reveals that the count argument to memset is nWordCount - 1 (line 1095) even though it was already decremented on line 1086 to account for the value already being copied into the first element of pDstData.
Change History (4)
by , 12 years ago
comment:1 by , 12 years ago
comment:2 by , 12 years ago
comment:3 by , 12 years ago
|Status:||new → closed|
r22420 /trunk/gdal/gcore/rasterio.cpp: GDALReplicateWord(): fix off-by-one error initialization in eDstType == GDT_Byte and nDstPixelOffset == 1 case (#4090, by bclaywell)
r22421 /branches/1.8/gdal/gcore/rasterio.cpp: GDALReplicateWord(): fix off-by-one error initialization in eDstType == GDT_Byte and nDstPixelOffset == 1 case (#4090, by bclaywell)
Even, perhaps this is your code?