- Fixed incorrect maximally-small float variable initialization to use -FLT_MAX instead of FLT_MIN. This glitch may have caused possible negative index access when using best overlap quick seek algorithm

- version to 1.9.3(pre)
This commit is contained in:
oparviai 2016-01-05 20:42:45 +00:00
parent 81cb7a3406
commit e1c7cffbcd
2 changed files with 7 additions and 11 deletions

View File

@ -79,10 +79,10 @@ namespace soundtouch
{ {
/// Soundtouch library version string /// Soundtouch library version string
#define SOUNDTOUCH_VERSION "1.9.2" #define SOUNDTOUCH_VERSION "1.9.3pre"
/// SoundTouch library version id /// SoundTouch library version id
#define SOUNDTOUCH_VERSION_ID (10902) #define SOUNDTOUCH_VERSION_ID (10903)
// //
// Available setting IDs for the 'setSetting' & 'get_setting' functions: // Available setting IDs for the 'setSetting' & 'get_setting' functions:

View File

@ -303,7 +303,7 @@ int TDStretch::seekBestOverlapPositionFull(const SAMPLETYPE *refPos)
int i; int i;
double norm; double norm;
bestCorr = FLT_MIN; bestCorr = -FLT_MAX;
bestOffs = 0; bestOffs = 0;
// Scans for the best correlation value by testing each possible position // Scans for the best correlation value by testing each possible position
@ -379,12 +379,10 @@ int TDStretch::seekBestOverlapPositionQuick(const SAMPLETYPE *refPos)
// note: 'float' types used in this function in case that the platform would need to use software-fp // note: 'float' types used in this function in case that the platform would need to use software-fp
bestCorr = FLT_MIN; bestCorr =
bestOffs = SCANWIND; bestCorr2 = -FLT_MAX;
bestCorr2 = FLT_MIN; bestOffs =
bestOffs2 = 0; bestOffs2 = SCANWIND;
int best = 0;
// Scans for the best correlation value by testing each possible position // Scans for the best correlation value by testing each possible position
// over the permitted range. Look for two best matches on the first pass to // over the permitted range. Look for two best matches on the first pass to
@ -442,7 +440,6 @@ int TDStretch::seekBestOverlapPositionQuick(const SAMPLETYPE *refPos)
{ {
bestCorr = corr; bestCorr = corr;
bestOffs = i; bestOffs = i;
best = 1;
} }
} }
@ -464,7 +461,6 @@ int TDStretch::seekBestOverlapPositionQuick(const SAMPLETYPE *refPos)
{ {
bestCorr = corr; bestCorr = corr;
bestOffs = i; bestOffs = i;
best = 2;
} }
} }