Skip to content

Commit

Permalink
fix: Check distance zero during the HRTF load
Browse files Browse the repository at this point in the history
  • Loading branch information
dgonzalezt committed Mar 18, 2024
1 parent b57e7b6 commit 37f3e74
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions include/Readers/SofaReader.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -256,6 +256,12 @@ namespace BRTReaders {

// Get and save HRIRs
double distance = sourcePositionsVector[array2DIndex(0, 2, numberOfMeasurements, numberOfCoordinates)]; //We consider that every HRIR are meased at the same distance, so we get the firts one

if (distance <= 0) {
SET_RESULT(RESULT_ERROR_INVALID_PARAM, "SOFA gives incoherent number of HRIRs distance");
return false;
}

dataHRTF->BeginSetup(numberOfSamples, distance, extrapolationMethod);

dataHRTF->SetSamplingRate(loader.GetSamplingRate());
Expand Down

0 comments on commit 37f3e74

Please sign in to comment.