Commit d5683420 authored by Michael Niedermayer's avatar Michael Niedermayer

aacenc: fix out of array writes

The value used in allocation is based on a estimate of the
maximum size of the spectral coefficients multiplied with 2
and rounded up. The exact or a tighter limit should be
found and used instead. But this issue shouldnt be left
open until someone works on that.
Signed-off-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parent 60b433d9
...@@ -576,7 +576,7 @@ static int aac_encode_frame(AVCodecContext *avctx, AVPacket *avpkt, ...@@ -576,7 +576,7 @@ static int aac_encode_frame(AVCodecContext *avctx, AVPacket *avpkt,
} }
start_ch += chans; start_ch += chans;
} }
if ((ret = ff_alloc_packet2(avctx, avpkt, 768 * s->channels))) { if ((ret = ff_alloc_packet2(avctx, avpkt, 8192 * s->channels))) {
av_log(avctx, AV_LOG_ERROR, "Error getting output packet\n"); av_log(avctx, AV_LOG_ERROR, "Error getting output packet\n");
return ret; return ret;
} }
......
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