Changeset 11182
- Timestamp:
- 04/02/07 20:20:00 (2 years ago)
- Files:
-
- trunk/gdal/gcore/gdal_misc.cpp (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/gdal/gcore/gdal_misc.cpp
r11174 r11182 1327 1327 const char *pszTFW; 1328 1328 char szExtUpper[32], szExtLower[32]; 1329 int i; 1330 char **papszLines; 1329 int i = 0; 1330 int nLinesCount = 0; 1331 char **papszLines = NULL; 1332 bool bValid = false; 1331 1333 1332 1334 /* -------------------------------------------------------------------- */ … … 1406 1408 papszLines = CSLLoad( pszTFW ); 1407 1409 1408 if( CSLCount(papszLines) >= 6 1409 && (CPLAtofM(papszLines[0]) != 0.0 || CPLAtofM(papszLines[2]) != 0.0) 1410 && (CPLAtofM(papszLines[3]) != 0.0 || CPLAtofM(papszLines[1]) != 0.0) ) 1410 nLinesCount = CSLCount(papszLines); 1411 if( nLinesCount >= 6 ) 1412 { 1413 bValid = true; 1414 1415 /* First six lines of a world file can not be empty. */ 1416 for( i = 0; i < 6; i++) 1417 { 1418 CPLString line(papszLines[i]); 1419 if( line.Trim().empty() ) 1420 { 1421 bValid = false; 1422 break; 1423 } 1424 } 1425 } 1426 else 1427 bValid = false; 1428 1429 1430 if( bValid ) 1411 1431 { 1412 1432 padfGeoTransform[0] = CPLAtofM(papszLines[4]);
