summaryrefslogtreecommitdiff
path: root/libavcodec/aacenc.c
diff options
context:
space:
mode:
authorAlex Converse <alex.converse@gmail.com>2010-05-06 20:35:10 +0000
committerAlex Converse <alex.converse@gmail.com>2010-05-06 20:35:10 +0000
commit217b44ddc3d5919f943a60f729886494b5fad692 (patch)
treeda58e5a82a2730c2906368af9d217d95be97ac80 /libavcodec/aacenc.c
parent32fa7725d288dcbdb6997130f1ca6edbcad25e1a (diff)
Error out when too many bits per frame are requested.
Originally committed as revision 23036 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/aacenc.c')
-rw-r--r--libavcodec/aacenc.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/libavcodec/aacenc.c b/libavcodec/aacenc.c
index ff68f84e7b..72e93a40c8 100644
--- a/libavcodec/aacenc.c
+++ b/libavcodec/aacenc.c
@@ -174,6 +174,10 @@ static av_cold int aac_encode_init(AVCodecContext *avctx)
av_log(avctx, AV_LOG_ERROR, "Unsupported profile %d\n", avctx->profile);
return -1;
}
+ if (1024.0 * avctx->bit_rate / avctx->sample_rate > 6144 * avctx->channels) {
+ av_log(avctx, AV_LOG_ERROR, "Too many bits per frame requested\n");
+ return -1;
+ }
s->samplerate_index = i;
dsputil_init(&s->dsp, avctx);