diff aacenc.c @ 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 7dd2a45249a9
children 15e7486e5c7a
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);