mirror of
https://github.com/azahar-emu/soundtouch
synced 2025-11-07 07:30:02 +01:00
Bugfix: Fixed variable initialization to avoid segment fault possibility due to negative array indexing in quick seek algorithm in presence of worst-case correlations.
This commit is contained in:
parent
1e11629a8f
commit
7560501414
@ -701,6 +701,7 @@ SoundTouch v1.3.1: </p>
|
|||||||
<li>Jason Garland</li>
|
<li>Jason Garland</li>
|
||||||
<li>Takashi Iwai</li>
|
<li>Takashi Iwai</li>
|
||||||
<li>Paulo Pizarro</li>
|
<li>Paulo Pizarro</li>
|
||||||
|
<li>RJ Ryan</li>
|
||||||
<li>John Sheehy</li>
|
<li>John Sheehy</li>
|
||||||
</ul>
|
</ul>
|
||||||
<p >Moral greetings to all other contributors and users also!</p>
|
<p >Moral greetings to all other contributors and users also!</p>
|
||||||
|
|||||||
@ -45,6 +45,7 @@
|
|||||||
#include <limits.h>
|
#include <limits.h>
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
#include <math.h>
|
#include <math.h>
|
||||||
|
#include <float.h>
|
||||||
#include <stdexcept>
|
#include <stdexcept>
|
||||||
|
|
||||||
#include "STTypes.h"
|
#include "STTypes.h"
|
||||||
@ -306,7 +307,7 @@ int TDStretch::seekBestOverlapPositionStereo(const SAMPLETYPE *refPos)
|
|||||||
// Slopes the amplitudes of the 'midBuffer' samples
|
// Slopes the amplitudes of the 'midBuffer' samples
|
||||||
precalcCorrReferenceStereo();
|
precalcCorrReferenceStereo();
|
||||||
|
|
||||||
bestCorr = INT_MIN;
|
bestCorr = FLT_MIN;
|
||||||
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
|
||||||
@ -350,8 +351,8 @@ int TDStretch::seekBestOverlapPositionStereoQuick(const SAMPLETYPE *refPos)
|
|||||||
// Slopes the amplitude of the 'midBuffer' samples
|
// Slopes the amplitude of the 'midBuffer' samples
|
||||||
precalcCorrReferenceStereo();
|
precalcCorrReferenceStereo();
|
||||||
|
|
||||||
bestCorr = INT_MIN;
|
bestCorr = FLT_MIN;
|
||||||
bestOffs = 0;
|
bestOffs = _scanOffsets[0][0];
|
||||||
corrOffset = 0;
|
corrOffset = 0;
|
||||||
tempOffset = 0;
|
tempOffset = 0;
|
||||||
|
|
||||||
@ -410,7 +411,7 @@ int TDStretch::seekBestOverlapPositionMono(const SAMPLETYPE *refPos)
|
|||||||
// Slopes the amplitude of the 'midBuffer' samples
|
// Slopes the amplitude of the 'midBuffer' samples
|
||||||
precalcCorrReferenceMono();
|
precalcCorrReferenceMono();
|
||||||
|
|
||||||
bestCorr = INT_MIN;
|
bestCorr = FLT_MIN;
|
||||||
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
|
||||||
@ -456,8 +457,8 @@ int TDStretch::seekBestOverlapPositionMonoQuick(const SAMPLETYPE *refPos)
|
|||||||
// Slopes the amplitude of the 'midBuffer' samples
|
// Slopes the amplitude of the 'midBuffer' samples
|
||||||
precalcCorrReferenceMono();
|
precalcCorrReferenceMono();
|
||||||
|
|
||||||
bestCorr = INT_MIN;
|
bestCorr = FLT_MIN;
|
||||||
bestOffs = 0;
|
bestOffs = _scanOffsets[0][0];
|
||||||
corrOffset = 0;
|
corrOffset = 0;
|
||||||
tempOffset = 0;
|
tempOffset = 0;
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user