changeset 11687:855ec3d8a62b libavcodec

Error out when too many bits per frame are requested.
author alexc
date Thu, 06 May 2010 20:35:10 +0000
parents 41a083a2527a
children 6f5bee041560
files aacenc.c
diffstat 1 files changed, 4 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/aacenc.c	Thu May 06 20:18:36 2010 +0000
+++ b/aacenc.c	Thu May 06 20:35:10 2010 +0000
@@ -174,6 +174,10 @@
         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);