summaryrefslogtreecommitdiff
path: root/libavcodec
diff options
context:
space:
mode:
authorReinhard Tartler <siretart@tauware.de>2010-05-19 11:38:30 +0000
committerReinhard Tartler <siretart@tauware.de>2010-05-19 11:38:30 +0000
commit3589ac6334c1281a9b2bee10ea8e549a5bc29cb5 (patch)
treefa16af5f7fb8d51008c0a12c45eee4229a4cbab3 /libavcodec
parentdd68bb3cab5ddc9bce93513ac0112a7a5fe3926f (diff)
Error out when too many bits per frame are requested.
backport r23036 by alexc Originally committed as revision 23183 to svn://svn.ffmpeg.org/ffmpeg/branches/0.6
Diffstat (limited to 'libavcodec')
-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);