aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2011-12-15 03:59:29 +0100
committerMichael Niedermayer <michaelni@gmx.at>2011-12-15 03:59:29 +0100
commit944f5b2779e4aa63f7624df6cd4de832a53db81b (patch)
tree3525d6a15840da0a82fccd9e8b9f4d614afe1a7a /libavcodec
parent7fff64e00d886fde11d61958888c82b461cf99b9 (diff)
downloadffmpeg-944f5b2779e4aa63f7624df6cd4de832a53db81b.tar.gz
aacsbr: Fix memory corruption.
Fixes Ticket760 and Ticket761 Bug Found by: Diana Elena Muscalu Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec')
-rw-r--r--libavcodec/aacsbr.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libavcodec/aacsbr.c b/libavcodec/aacsbr.c
index a213827132..d2f37c5e10 100644
--- a/libavcodec/aacsbr.c
+++ b/libavcodec/aacsbr.c
@@ -1187,7 +1187,7 @@ static void sbr_qmf_synthesis(DSPContext *dsp, FFTContext *mdct,
const float *sbr_qmf_window = div ? sbr_qmf_window_ds : sbr_qmf_window_us;
float *v;
for (i = 0; i < 32; i++) {
- if (*v_off == 0) {
+ if (*v_off < 128 >> div) {
int saved_samples = (1280 - 128) >> div;
memcpy(&v0[SBR_SYNTHESIS_BUF_SIZE - saved_samples], v0, saved_samples * sizeof(float));
*v_off = SBR_SYNTHESIS_BUF_SIZE - saved_samples - (128 >> div);