aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authortobigun <tobigun@b956fd51-792f-4845-bead-9b4dfca2ff2c>2008-09-06 09:48:41 +0000
committertobigun <tobigun@b956fd51-792f-4845-bead-9b4dfca2ff2c>2008-09-06 09:48:41 +0000
commit909cf4e491116930f6385e48165c6e770cf8505d (patch)
treecf19f3f34148087422c055a14d4c9b7fa9bf2c05
parentf5ea14a97fe530ff7670645c3c6e5051b961d2a7 (diff)
downloadusdx-909cf4e491116930f6385e48165c6e770cf8505d.tar.gz
usdx-909cf4e491116930f6385e48165c6e770cf8505d.tar.xz
usdx-909cf4e491116930f6385e48165c6e770cf8505d.zip
range-check fix:
"array[0..0] of TType" changed to "array[0 .. (MaxInt div SizeOf(TType))-1] of TType" git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@1347 b956fd51-792f-4845-bead-9b4dfca2ff2c
Diffstat (limited to '')
-rw-r--r--src/lib/fft/UFFT.pas14
1 files changed, 8 insertions, 6 deletions
diff --git a/src/lib/fft/UFFT.pas b/src/lib/fft/UFFT.pas
index 87c981e0..6b094c98 100644
--- a/src/lib/fft/UFFT.pas
+++ b/src/lib/fft/UFFT.pas
@@ -52,7 +52,7 @@ unit UFFT;
interface
type
- TSingleArray = array[0..0] of Single;
+ TSingleArray = array[0 .. (MaxInt div SizeOf(Single))-1] of Single;
PSingleArray = ^TSingleArray;
TFFTWindowFunc = (
@@ -142,9 +142,11 @@ implementation
uses
SysUtils;
-type TIntArray = array[0..0] of Integer;
-type TIntIntArray = array[0..0] of ^TIntArray;
-var gFFTBitTable: ^TIntIntArray;
+type TIntArray = array[0 .. (MaxInt div SizeOf(Integer))-1] of Integer;
+type PIntArray = ^TIntArray;
+type TIntIntArray = array[0 .. (MaxInt div SizeOf(PIntArray))-1] of PIntArray;
+type PIntIntArray = ^TIntIntArray;
+var gFFTBitTable: PIntIntArray;
const MaxFastBits: Integer = 16;
function IsPowerOfTwo(x: Integer): Boolean;
@@ -197,9 +199,9 @@ begin
len := 2;
for b := 1 to MaxFastBits do begin
- GetMem(gFFTBitTable^[b - 1], len * sizeof(Single));
+ GetMem(gFFTBitTable[b - 1], len * sizeof(Single));
for i := 0 to len-1 do
- gFFTBitTable^[b - 1][i] := ReverseBits(i, b);
+ gFFTBitTable[b - 1][i] := ReverseBits(i, b);
len := len shl 1;
end;
end;