Changeset 13499
- Timestamp:
- 01/08/08 17:02:11 (6 months ago)
- Files:
-
- trunk/gdal/gcore/gdaldriver.cpp (modified) (1 diff)
- trunk/gdal/gcore/gdalnodatamaskband.cpp (modified) (1 diff)
- trunk/gdal/gcore/gdalrasterblock.cpp (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/gdal/gcore/gdaldriver.cpp
r13353 r13499 188 188 CPLErr eErr = CE_None; 189 189 190 pData = VSIMalloc (nXSize *GDALGetDataTypeSize(eType) / 8);190 pData = VSIMalloc2(nXSize, GDALGetDataTypeSize(eType) / 8); 191 191 if( pData == NULL ) 192 192 { 193 193 CPLError( CE_Failure, CPLE_OutOfMemory, 194 "CreateCopy(): Out of memory allocating %d byte line buffer.\n", 195 nXSize * GDALGetDataTypeSize(eType) / 8 ); 194 "CopyBandImageData(): Out of memory.\n"); 196 195 eErr = CE_Failure; 197 196 } trunk/gdal/gcore/gdalnodatamaskband.cpp
r11975 r13499 108 108 CPLErr eErr; 109 109 110 pabySrc = (GByte *) 111 CPLMalloc( (GDALGetDataTypeSize(eWrkDT)/8)*nBlockXSize*nBlockYSize ); 110 pabySrc = (GByte *) VSIMalloc3( GDALGetDataTypeSize(eWrkDT)/8, nBlockXSize, nBlockYSize ); 111 if (pabySrc == NULL) 112 { 113 CPLError( CE_Failure, CPLE_OutOfMemory, 114 "GDALNoDataMaskBand::IReadBlock: Out of memory for buffer." ); 115 return CE_Failure; 116 } 112 117 113 118 eErr = poParent->ReadBlock( nXBlockOff, nYBlockOff, pabySrc ); trunk/gdal/gcore/gdalrasterblock.cpp
r12425 r13499 358 358 int nCurCacheMax = GDALGetCacheMax(); 359 359 360 //FIXME? : risk of overflow in multiplication 360 361 nSizeInBytes = nXSize * nYSize * (GDALGetDataTypeSize(eType) / 8); 361 362 … … 364 365 { 365 366 CPLError( CE_Failure, CPLE_OutOfMemory, 366 " Out of memory allocating %d byte raster cache block.",367 nSizeInBytes );367 "GDALRasterBlock::Internalize : Out of memory allocating %d bytes.", 368 nSizeInBytes); 368 369 return( CE_Failure ); 369 370 }
