Commit 217b44dd authored by Alex Converse's avatar Alex Converse

Error out when too many bits per frame are requested.

Originally committed as revision 23036 to svn://svn.ffmpeg.org/ffmpeg/trunk
parent 32fa7725
...@@ -174,6 +174,10 @@ static av_cold int aac_encode_init(AVCodecContext *avctx) ...@@ -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); av_log(avctx, AV_LOG_ERROR, "Unsupported profile %d\n", avctx->profile);
return -1; 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; s->samplerate_index = i;
dsputil_init(&s->dsp, avctx); dsputil_init(&s->dsp, avctx);
......
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