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

libavcodec/ac3enc.c:2706:1: Parameter `avctx->priv_data->channels`
2704.  * Initialize the encoder.
2705.  */
2706. static av_cold int ac3_encode_init(AVCodecContext *avctx)
      ^
2707. {
2708.     AC3EncodeContext *s = avctx->priv_data;

libavcodec/ac3enc.c:2717:11: Call
2715.     ff_ac3_common_init();
2716. 
2717.     ret = validate_options(avctx, s);
                ^
2718.     if (ret)
2719.         return ret;

libavcodec/ac3enc.c:2403:1: Parameter `s->channels`
  2401. 
  2402. 
  2403. static av_cold int validate_options(AVCodecContext *avctx, AC3EncodeContext *s)
        ^
  2404. {
  2405.     int i, ret, max_sr;

libavcodec/ac3enc.c:2413:11: Call
  2411.                                       "might be incorrect.\n");
  2412.     }
  2413.     ret = set_channel_info(s, avctx->channels, &avctx->channel_layout);
                  ^
  2414.     if (ret) {
  2415.         av_log(avctx, AV_LOG_ERROR, "invalid channel layout\n");

libavcodec/ac3enc.c:2358:1: Parameter `s->channels`
    2356.  * Set channel information during initialization.
    2357.  */
    2358. static av_cold int set_channel_info(AC3EncodeContext *s, int channels,
          ^
    2359.                                     int64_t *channel_layout)
    2360. {

libavcodec/ac3enc.c:2746:5: Call
2744.     exponent_init(s);
2745. 
2746.     bit_alloc_init(s);
          ^
2747. 
2748.     FF_ALLOCZ_OR_GOTO(avctx, s->mdct, sizeof(AC3MDCTContext), init_fail);

libavcodec/ac3enc.c:1069:1: <Offset trace>
1067.  * Set default parameter codes and calculate parameter values.
1068.  */
1069. static void bit_alloc_init(AC3EncodeContext *s)
      ^
1070. {
1071.     int ch;

libavcodec/ac3enc.c:1069:1: Parameter `s->channels`
  1067.  * Set default parameter codes and calculate parameter values.
  1068.  */
  1069. static void bit_alloc_init(AC3EncodeContext *s)
        ^
  1070. {
  1071.     int ch;

libavcodec/ac3enc.c:1069:1: <Length trace>
1067.  * Set default parameter codes and calculate parameter values.
1068.  */
1069. static void bit_alloc_init(AC3EncodeContext *s)
      ^
1070. {
1071.     int ch;

libavcodec/ac3enc.c:1069:1: Parameter `s->fast_gain_code[*]`
  1067.  * Set default parameter codes and calculate parameter values.
  1068.  */
  1069. static void bit_alloc_init(AC3EncodeContext *s)
        ^
  1070. {
  1071.     int ch;

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