libavcodec/ac3enc.c:2742: error: Buffer Overrun L2
  Offset: [-1+min(0, `avctx->priv_data->fbw_channels`), -1+max(7, `avctx->priv_data->fbw_channels`)] Size: 5 by call to `set_bandwidth`.

libavcodec/ac3enc.c:2706:1: Parameter `avctx->priv_data->fbw_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->fbw_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->fbw_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:2742:5: Call
2740.         s->output_frame_header = ac3_output_frame_header;
2741. 
2742.     set_bandwidth(s);
          ^
2743. 
2744.     exponent_init(s);

libavcodec/ac3enc.c:2530:1: <Offset trace>
2528.  * default value will be used.
2529.  */
2530. static av_cold void set_bandwidth(AC3EncodeContext *s)
      ^
2531. {
2532.     int blk, ch;

libavcodec/ac3enc.c:2530:1: Parameter `s->fbw_channels`
  2528.  * default value will be used.
  2529.  */
  2530. static av_cold void set_bandwidth(AC3EncodeContext *s)
        ^
  2531. {
  2532.     int blk, ch;

libavcodec/ac3enc.c:148:1: <Length trace>
146.  * bandwidth_tab[fbw_channels-1][sample rate code][bit rate code]
147.  */
148. static const uint8_t ac3_bandwidth_tab[5][3][19] = {
     ^
149. //      32  40  48  56  64  80  96 112 128 160 192 224 256 320 384 448 512 576 640
150. 

libavcodec/ac3enc.c:148:1: Array declaration
  146.  * bandwidth_tab[fbw_channels-1][sample rate code][bit rate code]
  147.  */
  148. static const uint8_t ac3_bandwidth_tab[5][3][19] = {
       ^
  149. //      32  40  48  56  64  80  96 112 128 160 192 224 256 320 384 448 512 576 640
  150. 

libavcodec/ac3enc.c:2542:29: Array access: Offset: [-1+min(0, avctx->priv_data->fbw_channels), -1+max(7, avctx->priv_data->fbw_channels)] Size: 5 by call to `set_bandwidth` 
  2540.     } else {
  2541.         /* use default bandwidth setting */
  2542.         s->bandwidth_code = ac3_bandwidth_tab[s->fbw_channels-1][s->bit_alloc.sr_code][s->frame_size_code/2];
                                    ^
  2543.     }
  2544. 
