Commit d8d17170 authored by Martijn van Beurden's avatar Martijn van Beurden Committed by Erik de Castro Lopo

libFLAC: fix more problems with new window functions

This fixes two problems with handling of out-of-bounds arguments
for the window functions, one of which involving an infinite loop
Signed-off-by: Erik de Castro Lopo's avatarErik de Castro Lopo <erikd@mega-nerd.com>
parent 9971e705
......@@ -215,9 +215,9 @@ void FLAC__window_partial_tukey(FLAC__real *window, const FLAC__int32 L, const F
FLAC__int32 Np, n, i;
if (p <= 0.0f)
FLAC__window_partial_tukey(window, L, 0.01f, start, end);
FLAC__window_partial_tukey(window, L, 0.05f, start, end);
else if (p >= 1.0f)
FLAC__window_partial_tukey(window, L, 1.0f, start, end);
FLAC__window_partial_tukey(window, L, 0.95f, start, end);
else {
Np = (FLAC__int32)(p / 2.0f * N);
......@@ -242,9 +242,9 @@ void FLAC__window_punchout_tukey(FLAC__real *window, const FLAC__int32 L, const
FLAC__int32 Ns, Ne, n, i;
if (p <= 0.0f)
FLAC__window_partial_tukey(window, L, 0.01f, start, end);
FLAC__window_punchout_tukey(window, L, 0.05f, start, end);
else if (p >= 1.0f)
FLAC__window_partial_tukey(window, L, 1.0f, start, end);
FLAC__window_punchout_tukey(window, L, 0.95f, start, end);
else {
Ns = (FLAC__int32)(p / 2.0f * start_n);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment