1
0
mirror of https://github.com/RPCS3/soundtouch.git synced 2024-11-08 20:12:27 +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:
oparviai 2009-11-09 17:27:50 +00:00
parent 1e11629a8f
commit 7560501414
2 changed files with 8 additions and 6 deletions

View File

@ -701,6 +701,7 @@ SoundTouch v1.3.1: </p>
<li>Jason Garland</li>
<li>Takashi Iwai</li>
<li>Paulo Pizarro</li>
<li>RJ Ryan</li>
<li>John Sheehy</li>
</ul>
<p >Moral greetings to all other contributors and users also!</p>

View File

@ -45,6 +45,7 @@
#include <limits.h>
#include <assert.h>
#include <math.h>
#include <float.h>
#include <stdexcept>
#include "STTypes.h"
@ -306,7 +307,7 @@ int TDStretch::seekBestOverlapPositionStereo(const SAMPLETYPE *refPos)
// Slopes the amplitudes of the 'midBuffer' samples
precalcCorrReferenceStereo();
bestCorr = INT_MIN;
bestCorr = FLT_MIN;
bestOffs = 0;
// 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
precalcCorrReferenceStereo();
bestCorr = INT_MIN;
bestOffs = 0;
bestCorr = FLT_MIN;
bestOffs = _scanOffsets[0][0];
corrOffset = 0;
tempOffset = 0;
@ -410,7 +411,7 @@ int TDStretch::seekBestOverlapPositionMono(const SAMPLETYPE *refPos)
// Slopes the amplitude of the 'midBuffer' samples
precalcCorrReferenceMono();
bestCorr = INT_MIN;
bestCorr = FLT_MIN;
bestOffs = 0;
// 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
precalcCorrReferenceMono();
bestCorr = INT_MIN;
bestOffs = 0;
bestCorr = FLT_MIN;
bestOffs = _scanOffsets[0][0];
corrOffset = 0;
tempOffset = 0;