[FFmpeg-devel] [PATCH 07/12] lpc: remove VLA in ff_lpc_compute_autocorr
Mans Rullgard
mans
Wed Jun 23 19:26:45 CEST 2010
---
libavcodec/lpc.c | 4 +++-
1 files changed, 3 insertions(+), 1 deletions(-)
diff --git a/libavcodec/lpc.c b/libavcodec/lpc.c
index 49e41d8..6b3cf01 100644
--- a/libavcodec/lpc.c
+++ b/libavcodec/lpc.c
@@ -59,7 +59,7 @@ void ff_lpc_compute_autocorr(const int32_t *data, int len, int lag,
double *autoc)
{
int i, j;
- double tmp[len + lag + 1];
+ double *tmp = av_malloc((len + lag + 1) * sizeof(*tmp));
double *data1= tmp + lag;
apply_welch_window(data, len, data1);
@@ -86,6 +86,8 @@ void ff_lpc_compute_autocorr(const int32_t *data, int len, int lag,
}
autoc[j] = sum;
}
+
+ av_free(tmp);
}
/**
--
1.7.1
More information about the ffmpeg-devel
mailing list