libavcodec/ac3enc.c:464: error: Buffer Overrun L1
  Offset added: 256 Size: 48 by call to `ff_ac3_bit_alloc_calc_bap`.

libavcodec/ac3enc.c:447:1: Parameter `(*bap)[*]`
445. }
446. 
447. static int bit_alloc(AC3EncodeContext *s,
     ^
448.                      int16_t mask[NB_BLOCKS][AC3_MAX_CHANNELS][50],
449.                      int16_t psd[NB_BLOCKS][AC3_MAX_CHANNELS][N/2],

libavcodec/ac3enc.c:464:13: Call
462.         s->mant4_cnt = 0;
463.         for(ch=0;ch<s->nb_all_channels;ch++) {
464.             ff_ac3_bit_alloc_calc_bap(mask[i][ch], psd[i][ch], 0,
                 ^
465.                                       s->nb_coefs[ch], snr_offset,
466.                                       s->bit_alloc.floor, ff_ac3_bap_tab,

libavcodec/ac3.c:175:1: <Length trace>
173. }
174. 
175. void ff_ac3_bit_alloc_calc_bap(int16_t *mask, int16_t *psd, int start, int end,
     ^
176.                                int snr_offset, int floor,
177.                                const uint8_t *bap_tab, uint8_t *bap)

libavcodec/ac3.c:175:1: Parameter `*bap`
  173. }
  174. 
  175. void ff_ac3_bit_alloc_calc_bap(int16_t *mask, int16_t *psd, int start, int end,
       ^
  176.                                int snr_offset, int floor,
  177.                                const uint8_t *bap_tab, uint8_t *bap)

libavcodec/ac3.c:183:9: Array access: Offset added: 256 Size: 48 by call to `ff_ac3_bit_alloc_calc_bap` 
  181.     /* special case, if snr offset is -960, set all bap's to zero */
  182.     if(snr_offset == -960) {
  183.         memset(bap, 0, 256);
               ^
  184.         return;
  185.     }

void ff_ac3_bit_alloc_calc_bap(int16_t *mask, int16_t *psd, int start, int end,
                               int snr_offset, int floor,
                               const uint8_t *bap_tab, uint8_t *bap)
{
    int i, j, k, end1, v, address;
    if(snr_offset == -960) {
        memset(bap, 0, 256);
        return;
    }
    i = start;
    j = bin_to_band_tab[start];
    do {
        v = (FFMAX(mask[j] - snr_offset - floor, 0) & 0x1FE0) + floor;
        end1 = FFMIN(band_start_tab[j] + ff_ac3_critical_band_size_tab[j], end);
        for (k = i; k < end1; k++) {
            address = av_clip((psd[i] - v) >> 5, 0, 63);
            bap[i] = bap_tab[address];
            i++;
        }
    } while (end > band_start_tab[j++]);
}
['static int bit_alloc(AC3EncodeContext *s,\n                     int16_t mask[NB_BLOCKS][AC3_MAX_CHANNELS][50],\n                     int16_t psd[NB_BLOCKS][AC3_MAX_CHANNELS][N/2],\n                     uint8_t bap[NB_BLOCKS][AC3_MAX_CHANNELS][N/2],\n                     int frame_bits, int coarse_snr_offset, int fine_snr_offset)\n{\n    int i, ch;\n    int snr_offset;\n    snr_offset = (((coarse_snr_offset - 15) << 4) + fine_snr_offset) << 2;\n    for(i=0;i<NB_BLOCKS;i++) {\n        s->mant1_cnt = 0;\n        s->mant2_cnt = 0;\n        s->mant4_cnt = 0;\n        for(ch=0;ch<s->nb_all_channels;ch++) {\n            ff_ac3_bit_alloc_calc_bap(mask[i][ch], psd[i][ch], 0,\n                                      s->nb_coefs[ch], snr_offset,\n                                      s->bit_alloc.floor, ff_ac3_bap_tab,\n                                      bap[i][ch]);\n            frame_bits += compute_mantissa_size(s, bap[i][ch],\n                                                 s->nb_coefs[ch]);\n        }\n    }\n#if 0\n    printf("csnr=%d fsnr=%d frame_bits=%d diff=%d\\n",\n           coarse_snr_offset, fine_snr_offset, frame_bits,\n           16 * s->frame_size - ((frame_bits + 7) & ~7));\n#endif\n    return 16 * s->frame_size - frame_bits;\n}', 'void ff_ac3_bit_alloc_calc_bap(int16_t *mask, int16_t *psd, int start, int end,\n                               int snr_offset, int floor,\n                               const uint8_t *bap_tab, uint8_t *bap)\n{\n    int i, j, k, end1, v, address;\n    if(snr_offset == -960) {\n        memset(bap, 0, 256);\n        return;\n    }\n    i = start;\n    j = bin_to_band_tab[start];\n    do {\n        v = (FFMAX(mask[j] - snr_offset - floor, 0) & 0x1FE0) + floor;\n        end1 = FFMIN(band_start_tab[j] + ff_ac3_critical_band_size_tab[j], end);\n        for (k = i; k < end1; k++) {\n            address = av_clip((psd[i] - v) >> 5, 0, 63);\n            bap[i] = bap_tab[address];\n            i++;\n        }\n    } while (end > band_start_tab[j++]);\n}']