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

libavcodec/ac3enc.c:2967:1: Parameter `avctx->priv_data->channels`
2965.  * Initialize the encoder.
2966.  */
2967. static av_cold int ac3_encode_init(AVCodecContext *avctx)
      ^
2968. {
2969.     AC3EncodeContext *s = avctx->priv_data;

libavcodec/ac3enc.c:2978:11: Call
2976.     ff_ac3_common_init();
2977. 
2978.     ret = validate_options(avctx, s);
                ^
2979.     if (ret)
2980.         return ret;

libavcodec/ac3enc.c:2663:1: Parameter `s->channels`
  2661. 
  2662. 
  2663. static av_cold int validate_options(AVCodecContext *avctx, AC3EncodeContext *s)
        ^
  2664. {
  2665.     int i, ret, max_sr;

libavcodec/ac3enc.c:2673:11: Call
  2671.                                       "might be incorrect.\n");
  2672.     }
  2673.     ret = set_channel_info(s, avctx->channels, &avctx->channel_layout);
                  ^
  2674.     if (ret) {
  2675.         av_log(avctx, AV_LOG_ERROR, "invalid channel layout\n");

libavcodec/ac3enc.c:2618:1: Parameter `s->channels`
    2616.  * Set channel information during initialization.
    2617.  */
    2618. static av_cold int set_channel_info(AC3EncodeContext *s, int channels,
          ^
    2619.                                     int64_t *channel_layout)
    2620. {

libavcodec/ac3enc.c:3001:5: Call
2999.     exponent_init(s);
3000. 
3001.     bit_alloc_init(s);
          ^
3002. 
3003.     ret = mdct_init(avctx, &s->mdct, 9);

libavcodec/ac3enc.c:1271:1: <Offset trace>
1269.  * Set default parameter codes and calculate parameter values.
1270.  */
1271. static void bit_alloc_init(AC3EncodeContext *s)
      ^
1272. {
1273.     int ch;

libavcodec/ac3enc.c:1271:1: Parameter `s->channels`
  1269.  * Set default parameter codes and calculate parameter values.
  1270.  */
  1271. static void bit_alloc_init(AC3EncodeContext *s)
        ^
  1272. {
  1273.     int ch;

libavcodec/ac3enc.c:1271:1: <Length trace>
1269.  * Set default parameter codes and calculate parameter values.
1270.  */
1271. static void bit_alloc_init(AC3EncodeContext *s)
      ^
1272. {
1273.     int ch;

libavcodec/ac3enc.c:1271:1: Parameter `s->fast_gain_code[*]`
  1269.  * Set default parameter codes and calculate parameter values.
  1270.  */
  1271. static void bit_alloc_init(AC3EncodeContext *s)
        ^
  1272. {
  1273.     int ch;

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