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

libavcodec/ac3enc.c:2164:1: Parameter `avctx->priv_data->fbw_channels`
2162.  * Initialize the encoder.
2163.  */
2164. static av_cold int ac3_encode_init(AVCodecContext *avctx)
      ^
2165. {
2166.     AC3EncodeContext *s = avctx->priv_data;

libavcodec/ac3enc.c:2173:11: Call
2171.     ff_ac3_common_init();
2172. 
2173.     ret = validate_options(avctx, s);
                ^
2174.     if (ret)
2175.         return ret;

libavcodec/ac3enc.c:1969:1: Parameter `s->fbw_channels`
  1967. 
  1968. 
  1969. static av_cold int validate_options(AVCodecContext *avctx, AC3EncodeContext *s)
        ^
  1970. {
  1971.     int i, ret;

libavcodec/ac3enc.c:1979:11: Call
  1977.                                       "might be incorrect.\n");
  1978.     }
  1979.     ret = set_channel_info(s, avctx->channels, &avctx->channel_layout);
                  ^
  1980.     if (ret) {
  1981.         av_log(avctx, AV_LOG_ERROR, "invalid channel layout\n");

libavcodec/ac3enc.c:1924:1: Parameter `s->fbw_channels`
    1922.  * Set channel information during initialization.
    1923.  */
    1924. static av_cold int set_channel_info(AC3EncodeContext *s, int channels,
          ^
    1925.                                     int64_t *channel_layout)
    1926. {

libavcodec/ac3enc.c:2194:5: Call
2192.     }
2193. 
2194.     set_bandwidth(s);
          ^
2195. 
2196.     exponent_init(s);

libavcodec/ac3enc.c:2048:1: <Offset trace>
2046.  * default value will be used.
2047.  */
2048. static av_cold void set_bandwidth(AC3EncodeContext *s)
      ^
2049. {
2050.     int ch;

libavcodec/ac3enc.c:2048:1: Parameter `s->fbw_channels`
  2046.  * default value will be used.
  2047.  */
  2048. static av_cold void set_bandwidth(AC3EncodeContext *s)
        ^
  2049. {
  2050.     int ch;

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

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

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