<div dir="ltr">Assuming that VRTBuilder class inside gdalbuildvrt.cpp has been created to be reusable, I have some comments/questions that, depending on your input, may end up in pull requests.<br><ul><li><b>VRTBuilder::VRTBuilder, line 300</b></li>
</ul><p>Instead of assigning the pointer create a copy to be consistent with the rest of the code. The memory is released twice, once at 1558 with <br></p><p><span style="font-family:courier new,monospace">CPLFree( panBandList );</span></p>
<p> and once at 347 with <br></p><p><span style="font-family:courier new,monospace">delete[] panBandList;</span><br></p><ul><li><b>VRTBuilder::pasDatasetProperties line 237</b><br></li></ul><p>At line 1092 AnalyseRaster is called with a pointer inside pasDatasetProperties </p>
<p><span style="font-family:courier new,monospace">if (AnalyseRaster( hDS, dsFileName, &pasDatasetProperties[i] ))</span></p><p>However the array may be re-allocated at line 416; if the reallocation is not in place the psDatasetProperties pointer will be invalid.</p>
<p>Maybe passing an index instead of a pointer can solve the problem.<br></p><ul><li><b>line 513-520</b></li></ul><p>What would it take to support rotated, positive NS resolutions?<br></p><ul><li><b>line 543</b></li></ul>
<p>Assumes that there is at least one band; The code below does not make that assumption and checks for that condition; GDALGetBlockSize() does not handle a NULL pointer.</p><ul><li><b>line 825, 920<br></b></li></ul><p>Why the GDALProxyPoolDatasetH? Why not opening it like a regular data set? When creating VRT files in C++ code this is the path to be taken?</p>
<p><br></p><p>Regards,</p><p>Nicu<br></p></div>