libavcodec/ac3enc.c:2377: 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:2321:9: Parameter `avctx->priv_data->fbw_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->fbw_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->fbw_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:2377:5: Call
2375.         s->output_frame_header = ac3_output_frame_header;
2376. 
2377.     set_bandwidth(s);
          ^
2378. 
2379.     exponent_init(s);

libavcodec/ac3enc.c:2145:1: <Offset trace>
2143.  * default value will be used.
2144.  */
2145. static av_cold void set_bandwidth(AC3EncodeContext *s)
      ^
2146. {
2147.     int blk, ch;

libavcodec/ac3enc.c:2145:1: Parameter `s->fbw_channels`
  2143.  * default value will be used.
  2144.  */
  2145. static av_cold void set_bandwidth(AC3EncodeContext *s)
        ^
  2146. {
  2147.     int blk, ch;

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

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

libavcodec/ac3enc.c:2157: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` 
  2155.     } else {
  2156.         /* use default bandwidth setting */
  2157.         s->bandwidth_code = ac3_bandwidth_tab[s->fbw_channels-1][s->bit_alloc.sr_code][s->frame_size_code/2];
                                    ^
  2158.     }
  2159. 
