Changeset 15081
- Timestamp:
- 07/30/08 15:23:58 (4 months ago)
- Files:
-
- trunk/gdal/ogr/ogrsf_frmts/avc/HISTORY.TXT (modified) (2 diffs)
- trunk/gdal/ogr/ogrsf_frmts/avc/avc_e00read.c (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/gdal/ogr/ogrsf_frmts/avc/HISTORY.TXT
r15077 r15081 18 18 - Detect compressed E00 input files and refuse to open them instead of 19 19 crashing (bug 1928, GDAL/OGR ticket 2513) 20 21 - Avoid scanning the whole E00 input file in AVCE00ReadOpenE00() if the file 22 does not start with an EXP line (GDAL/OGR ticket 1989) 20 23 21 24 … … 297 300 298 301 --------- 299 $Id: HISTORY.TXT,v 1.3 1 2008/07/30 16:17:46dmorissette Exp $302 $Id: HISTORY.TXT,v 1.32 2008/07/30 18:35:53 dmorissette Exp $ trunk/gdal/ogr/ogrsf_frmts/avc/avc_e00read.c
r15077 r15081 1 1 /********************************************************************** 2 * $Id: avc_e00read.c,v 1.2 6 2008/07/30 16:17:46dmorissette Exp $2 * $Id: avc_e00read.c,v 1.28 2008/07/30 19:22:18 dmorissette Exp $ 3 3 * 4 4 * Name: avc_e00read.c … … 33 33 * 34 34 * $Log: avc_e00read.c,v $ 35 * Revision 1.28 2008/07/30 19:22:18 dmorissette 36 * Move detection of EXP header directly in AVCE00ReadOpenE00() and use 37 * VSIFGets() instead of CPLReadLine() to avoid problem with huge one line 38 * files (GDAL/OGR ticket #1989) 39 * 40 * Revision 1.27 2008/07/30 18:35:53 dmorissette 41 * Avoid scanning the whole E00 input file in AVCE00ReadOpenE00() if the 42 * file does not start with an EXP line (GDAL/OGR ticket 1989) 43 * 35 44 * Revision 1.26 2008/07/30 16:17:46 dmorissette 36 45 * Detect compressed E00 input files and refuse to open them instead of … … 400 409 FILE *fp; 401 410 char *p; 411 char szHeader[10]; 402 412 403 413 CPLErrorReset(); … … 417 427 } 418 428 419 if (NULL == (fp = fopen(pszE00FileName, "r")))429 if (NULL == (fp = VSIFOpen(pszE00FileName, "r"))) 420 430 return NULL; 431 432 /*----------------------------------------------------------------- 433 * Make sure the file starts with a "EXP 0" or "EXP 1" header 434 *----------------------------------------------------------------*/ 435 if (VSIFGets(szHeader, 5, fp) == NULL || !EQUALN("EXP ", szHeader, 4) ) 436 { 437 CPLError(CE_Failure, CPLE_OpenFailed, 438 "This does not look like a E00 file: does not start with " 439 "a EXP header." ); 440 VSIFClose(fp); 441 return NULL; 442 } 443 VSIRewind(fp); 421 444 422 445 /*----------------------------------------------------------------- … … 543 566 if (psRead->hFile) 544 567 { 545 fclose(psRead->hFile);568 VSIFClose(psRead->hFile); 546 569 psRead->hFile = 0; 547 570 } … … 1341 1364 if (bFirstLine) 1342 1365 { 1343 /* Look for the first non-empty line, trying to detect compressed1344 * E00 files. If the file is compressed, the first line of data1345 * should be 79 or 80 characters long and contain several '~'1346 * characters.1366 /* Look for the first non-empty line, after the EXP header, 1367 * trying to detect compressed E00 files. If the file is 1368 * compressed, the first line of data should be 79 or 80 chars 1369 * long and contain several '~' characters. 1347 1370 */ 1348 1371 int nLen = strlen(pszLine);
