libavcodec/twinvq.c:1089: error: Buffer Overrun L2
  Offset: [0, 4] (⇐ [0, 3] + [0, 1]) Size: 4 by call to `construct_perm_table`.

libavcodec/twinvq.c:1088:10: Assignment
1086.     }
1087. 
1088.     for (frametype = FT_SHORT; frametype <= FT_PPC; frametype++)
               ^
1089.         construct_perm_table(tctx, frametype);
1090. }

libavcodec/twinvq.c:1089:9: Call
1087. 
1088.     for (frametype = FT_SHORT; frametype <= FT_PPC; frametype++)
1089.         construct_perm_table(tctx, frametype);
              ^
1090. }
1091. 

libavcodec/twinvq.c:997:1: Parameter `ftype`
  995. }
  996. 
  997. static av_cold void construct_perm_table(TwinVQContext *tctx,
       ^
  998.                                          enum TwinVQFrameType ftype)
  999. {

libavcodec/twinvq.c:1016:5: Call
  1014.                       tctx->length_change[ftype], ftype);
  1015. 
  1016.     transpose_perm(tctx->permut[ftype], tmp_perm, tctx->n_div[ftype],
            ^
  1017.                    tctx->length[ftype], tctx->length_change[ftype]);
  1018. 

libavcodec/twinvq.c:984:34: <Offset trace>
982. 
983.     for (i = 0; i < num_vect; i++)
984.         for (j = 0; j < line_len[i >= length_div]; j++)
                                      ^
985.             out[cont++] = in[j * num_vect + i];
986. }

libavcodec/twinvq.c:984:34: Assignment
    982. 
    983.     for (i = 0; i < num_vect; i++)
    984.         for (j = 0; j < line_len[i >= length_div]; j++)
                                          ^
    985.             out[cont++] = in[j * num_vect + i];
    986. }

libavcodec/twinvq.c:977:1: <Length trace>
975.  * aiqxbjr1cks2dlt3emu4fvn5gow6hp
976.  */
977. static void transpose_perm(int16_t *out, int16_t *in, int num_vect,
     ^
978.                            const uint8_t line_len[2], int length_div)
979. {

libavcodec/twinvq.c:977:1: Parameter `*line_len`
    975.  * aiqxbjr1cks2dlt3emu4fvn5gow6hp
    976.  */
    977. static void transpose_perm(int16_t *out, int16_t *in, int num_vect,
         ^
    978.                            const uint8_t line_len[2], int length_div)
    979. {

libavcodec/twinvq.c:984:25: Array access: Offset: [0, 4] (⇐ [0, 3] + [0, 1]) Size: 4 by call to `construct_perm_table` 
    982. 
    983.     for (i = 0; i < num_vect; i++)
    984.         for (j = 0; j < line_len[i >= length_div]; j++)
                                 ^
    985.             out[cont++] = in[j * num_vect + i];
    986. }

static void transpose_perm(int16_t *out, int16_t *in, int num_vect,
                           const uint8_t line_len[2], int length_div)
{
    int i, j;
    int cont = 0;
    for (i = 0; i < num_vect; i++)
        for (j = 0; j < line_len[i >= length_div]; j++)
            out[cont++] = in[j * num_vect + i];
}
['static av_cold void init_bitstream_params(TwinVQContext *tctx)\n{\n    const TwinVQModeTab *mtab = tctx->mtab;\n    int n_ch                  = tctx->avctx->channels;\n    int total_fr_bits         = tctx->avctx->bit_rate * mtab->size /\n                                tctx->avctx->sample_rate;\n    int lsp_bits_per_block = n_ch * (mtab->lsp_bit0 + mtab->lsp_bit1 +\n                                     mtab->lsp_split * mtab->lsp_bit2);\n    int ppc_bits = n_ch * (mtab->pgain_bit + mtab->ppc_shape_bit +\n                           mtab->ppc_period_bit);\n    int bsize_no_main_cb[3], bse_bits[3], i;\n    enum TwinVQFrameType frametype;\n    for (i = 0; i < 3; i++)\n        bse_bits[i] = n_ch *\n                      (mtab->fmode[i].bark_n_coef *\n                       mtab->fmode[i].bark_n_bit + 1);\n    bsize_no_main_cb[2] = bse_bits[2] + lsp_bits_per_block + ppc_bits +\n                          WINDOW_TYPE_BITS + n_ch * GAIN_BITS;\n    for (i = 0; i < 2; i++)\n        bsize_no_main_cb[i] =\n            lsp_bits_per_block + n_ch * GAIN_BITS + WINDOW_TYPE_BITS +\n            mtab->fmode[i].sub * (bse_bits[i] + n_ch * SUB_GAIN_BITS);\n    for (i = 0; i < 4; i++) {\n        int bit_size, vect_size;\n        int rounded_up, rounded_down, num_rounded_down, num_rounded_up;\n        if (i == 3) {\n            bit_size  = n_ch * mtab->ppc_shape_bit;\n            vect_size = n_ch * mtab->ppc_shape_len;\n        } else {\n            bit_size  = total_fr_bits - bsize_no_main_cb[i];\n            vect_size = n_ch * mtab->size;\n        }\n        tctx->n_div[i] = (bit_size + 13) / 14;\n        rounded_up                     = (bit_size + tctx->n_div[i] - 1) /\n                                         tctx->n_div[i];\n        rounded_down                   = (bit_size) / tctx->n_div[i];\n        num_rounded_down               = rounded_up * tctx->n_div[i] - bit_size;\n        num_rounded_up                 = tctx->n_div[i] - num_rounded_down;\n        tctx->bits_main_spec[0][i][0]  = (rounded_up + 1)   / 2;\n        tctx->bits_main_spec[1][i][0]  =  rounded_up        / 2;\n        tctx->bits_main_spec[0][i][1]  = (rounded_down + 1) / 2;\n        tctx->bits_main_spec[1][i][1]  =  rounded_down      / 2;\n        tctx->bits_main_spec_change[i] = num_rounded_up;\n        rounded_up             = (vect_size + tctx->n_div[i] - 1) /\n                                 tctx->n_div[i];\n        rounded_down           = (vect_size) / tctx->n_div[i];\n        num_rounded_down       = rounded_up * tctx->n_div[i] - vect_size;\n        num_rounded_up         = tctx->n_div[i] - num_rounded_down;\n        tctx->length[i][0]     = rounded_up;\n        tctx->length[i][1]     = rounded_down;\n        tctx->length_change[i] = num_rounded_up;\n    }\n    for (frametype = FT_SHORT; frametype <= FT_PPC; frametype++)\n        construct_perm_table(tctx, frametype);\n}', 'static av_cold void construct_perm_table(TwinVQContext *tctx,\n                                         enum TwinVQFrameType ftype)\n{\n    int block_size, size;\n    const TwinVQModeTab *mtab = tctx->mtab;\n    int16_t *tmp_perm = (int16_t *)tctx->tmp_buf;\n    if (ftype == FT_PPC) {\n        size       = tctx->avctx->channels;\n        block_size = mtab->ppc_shape_len;\n    } else {\n        size       = tctx->avctx->channels * mtab->fmode[ftype].sub;\n        block_size = mtab->size / mtab->fmode[ftype].sub;\n    }\n    permutate_in_line(tmp_perm, tctx->n_div[ftype], size,\n                      block_size, tctx->length[ftype],\n                      tctx->length_change[ftype], ftype);\n    transpose_perm(tctx->permut[ftype], tmp_perm, tctx->n_div[ftype],\n                   tctx->length[ftype], tctx->length_change[ftype]);\n    linear_perm(tctx->permut[ftype], tctx->permut[ftype], size,\n                size * block_size);\n}', 'static void transpose_perm(int16_t *out, int16_t *in, int num_vect,\n                           const uint8_t line_len[2], int length_div)\n{\n    int i, j;\n    int cont = 0;\n    for (i = 0; i < num_vect; i++)\n        for (j = 0; j < line_len[i >= length_div]; j++)\n            out[cont++] = in[j * num_vect + i];\n}']