]> git.sesse.net Git - ffmpeg/commitdiff
aacenc: allocate a larger buffer for the TNS LPC context
authorRostislav Pehlivanov <atomnuker@gmail.com>
Tue, 1 Sep 2015 05:40:12 +0000 (06:40 +0100)
committerRostislav Pehlivanov <atomnuker@gmail.com>
Tue, 1 Sep 2015 05:40:12 +0000 (06:40 +0100)
Turns out autocorrelating more than 750 coefficients at once
will cause a segfault, despite there being enough space to
hold an entire frame of samples into the buffer.

Signed-off-by: Rostislav Pehlivanov <atomnuker@gmail.com>
libavcodec/aacenc.c

index 62dba34ee4ac019ec8aabb9b81849149a10081ea..232eeda04fafd42101635d932f99d242a511f5a7 100644 (file)
@@ -825,7 +825,7 @@ static av_cold int aac_encode_init(AVCodecContext *avctx)
         goto fail;
     s->psypp = ff_psy_preprocess_init(avctx);
     s->coder = &ff_aac_coders[s->options.aac_coder];
-    ff_lpc_init(&s->lpc, avctx->frame_size, MAX_LPC_ORDER, FF_LPC_TYPE_LEVINSON);
+    ff_lpc_init(&s->lpc, 2*avctx->frame_size, TNS_MAX_ORDER, FF_LPC_TYPE_LEVINSON);
 
     if (HAVE_MIPSDSPR1)
         ff_aac_coder_init_mips(s);