Skip to content

Commit

Permalink
update MDAL to 0.7.0
Browse files Browse the repository at this point in the history
  • Loading branch information
PeterPetrik authored and nyalldawson committed Sep 10, 2020
1 parent ed91cee commit 5a1fe64
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 6 deletions.
7 changes: 5 additions & 2 deletions external/mdal/frmts/mdal_gdal_netcdf.cpp
Expand Up @@ -39,8 +39,11 @@ bool MDAL::DriverGdalNetCDF::parseBandInfo( const MDAL::GdalDataset *cfGDALDatas
metadata_hash::const_iterator iter;

iter = metadata.find( "netcdf_dim_time" );
if ( iter == metadata.end() ) return true; //FAILURE, skip no-time bands
*time = MDAL::RelativeTimestamp( parseMetadataTime( iter->second ), mTimeUnit );

if ( iter == metadata.end() )
*time = MDAL::RelativeTimestamp();
else
*time = MDAL::RelativeTimestamp( parseMetadataTime( iter->second ), mTimeUnit );

// NAME
iter = metadata.find( "long_name" );
Expand Down
2 changes: 1 addition & 1 deletion external/mdal/mdal.cpp
Expand Up @@ -21,7 +21,7 @@ static const char *EMPTY_STR = "";

const char *MDAL_Version()
{
return "0.6.93";
return "0.7.0";
}

MDAL_Status MDAL_LastStatus()
Expand Down
12 changes: 9 additions & 3 deletions external/mdal/mdal_memory_data_model.cpp
Expand Up @@ -205,9 +205,15 @@ void MDAL::MemoryMesh::addFaces( size_t faceCount, size_t driverMaxVerticesPerFa
Face face( faceSize );
for ( size_t i = 0; i < faceSize; ++i )
{
size_t indice = vertexIndices[indicesIndex + i];
if ( indice >= 0 && indice < mVertices.size() )
face[i] = indice;
const int indice = vertexIndices[indicesIndex + i];
if ( indice < 0 )
{
MDAL::Log::error( Err_InvalidData, "Invalid vertex index when adding faces" );
return;
}
size_t indiceU = static_cast< size_t >( indice );
if ( indiceU < mVertices.size() )
face[i] = indiceU;
else
{
MDAL::Log::error( Err_InvalidData, "Invalid vertex index when adding faces" );
Expand Down

0 comments on commit 5a1fe64

Please sign in to comment.