libavcodec/ac3enc.c:2381: error: Buffer Overrun L2
  Offset: [0, max(7, `avctx->priv_data->channels`)] Size: 7 by call to `bit_alloc_init`.

libavcodec/ac3enc.c:2321:9: Parameter `avctx->priv_data->channels`
2319.  * Initialize the encoder.
2320.  */
2321. av_cold int ff_ac3_encode_init(AVCodecContext *avctx)
              ^
2322. {
2323.     AC3EncodeContext *s = avctx->priv_data;

libavcodec/ac3enc.c:2332:11: Call
2330.     ff_ac3_common_init();
2331. 
2332.     ret = validate_options(avctx, s);
                ^
2333.     if (ret)
2334.         return ret;

libavcodec/ac3enc.c:2019:1: Parameter `s->channels`
  2017. 
  2018. 
  2019. static av_cold int validate_options(AVCodecContext *avctx, AC3EncodeContext *s)
        ^
  2020. {
  2021.     int i, ret, max_sr;

libavcodec/ac3enc.c:2029:11: Call
  2027.                                       "might be incorrect.\n");
  2028.     }
  2029.     ret = set_channel_info(s, avctx->channels, &avctx->channel_layout);
                  ^
  2030.     if (ret) {
  2031.         av_log(avctx, AV_LOG_ERROR, "invalid channel layout\n");

libavcodec/ac3enc.c:1974:1: Parameter `s->channels`
    1972.  * Set channel information during initialization.
    1973.  */
    1974. static av_cold int set_channel_info(AC3EncodeContext *s, int channels,
          ^
    1975.                                     int64_t *channel_layout)
    1976. {

libavcodec/ac3enc.c:2381:5: Call
2379.     exponent_init(s);
2380. 
2381.     bit_alloc_init(s);
          ^
2382. 
2383.     FF_ALLOCZ_OR_GOTO(avctx, s->mdct, sizeof(AC3MDCTContext), init_fail);

libavcodec/ac3enc.c:685:1: <Offset trace>
683.  * Set default parameter codes and calculate parameter values.
684.  */
685. static void bit_alloc_init(AC3EncodeContext *s)
     ^
686. {
687.     int ch;

libavcodec/ac3enc.c:685:1: Parameter `s->channels`
  683.  * Set default parameter codes and calculate parameter values.
  684.  */
  685. static void bit_alloc_init(AC3EncodeContext *s)
       ^
  686. {
  687.     int ch;

libavcodec/ac3enc.c:685:1: <Length trace>
683.  * Set default parameter codes and calculate parameter values.
684.  */
685. static void bit_alloc_init(AC3EncodeContext *s)
     ^
686. {
687.     int ch;

libavcodec/ac3enc.c:685:1: Parameter `s->fast_gain_code[*]`
  683.  * Set default parameter codes and calculate parameter values.
  684.  */
  685. static void bit_alloc_init(AC3EncodeContext *s)
       ^
  686. {
  687.     int ch;

libavcodec/ac3enc.c:696:9: Array access: Offset: [0, max(7, avctx->priv_data->channels)] Size: 7 by call to `bit_alloc_init` 
  694.     s->floor_code      = 7;
  695.     for (ch = 0; ch <= s->channels; ch++)
  696.         s->fast_gain_code[ch] = 4;
               ^
  697. 
  698.     /* initial snr offset */
