OSGeo / gdal

GDAL is an open source MIT licensed translator library for raster and vector geospatial data formats.
https://gdal.org
Other
4.91k stars 2.55k forks source link

GDALBuildvrt fails on the A.TOC file #893

Closed mg629 closed 6 years ago

mg629 commented 6 years ago

I am getting the following error when I run gdalbuildvrt with an input file list. The TOC file I reference in the input file list is not corrupt (see attachment), so what might I be doing wrong?

ERROR 6: Path length is big : 4096. Probably corrupted TOC file. Warning 1: Can't open C:\MyFolder\A.TOC. Skipping it

I put it in a zip so I could attach it. (toc extension is not accepted) A.zip

jratike80 commented 6 years ago

Last revision in the source code that contains error message "Path length is big" is https://trac.osgeo.org/gdal/browser/trunk/gdal/frmts/nitf/rpftocfile.cpp?rev=38534.

Current version does not seem to be much different when it comes to the logic even the message is now "Path length is invalid". See https://github.com/OSGeo/gdal/blob/master/gdal/frmts/nitf/rpftocfile.cpp#L564

rouault commented 6 years ago

Hum, I can't reproduce your error. gdalinfo on A.TOC works (with many warnings since the CADRG tiles referenced are missing). Did you build GDAL by yourself ? When debugging on your sample, the value of pathLength at line https://github.com/OSGeo/gdal/blob/master/gdal/frmts/nitf/rpftocfile.cpp#L566 is 16. But interestingly, if the byte swapping inversion done on the previous line wasn't done, the value you would get is 4096 ( 0x1000 = 4096 and 0x0010 = 16 ). But there are a number of byte swapping occuring before so if that was an endianness related issue, they should likely have triggered;

rouault commented 6 years ago

Closing due to lack of feedback