libavcodec/g723_1enc.c:250: error: Buffer Overrun L3
  Offset: [-511, 511] Size: 513.

libavcodec/g723_1enc.c:246:10: <Offset trace>
244.     prev_val = av_clipl_int32(temp << 1);
245.     count    = 0;
246.     for (i = 1; i < COS_TBL_SIZE / 2; i++) {
              ^
247.         /* Evaluate */
248.         temp = 0;

libavcodec/g723_1enc.c:246:10: Assignment
244.     prev_val = av_clipl_int32(temp << 1);
245.     count    = 0;
246.     for (i = 1; i < COS_TBL_SIZE / 2; i++) {
              ^
247.         /* Evaluate */
248.         temp = 0;

libavcodec/g723_1.h:229:1: <Length trace>
227. 
228. /* Cosine table scaled by 2^14 */
229. static const int16_t cos_tab[COS_TBL_SIZE + 1] = {
     ^
230.     16384,  16383,  16379,  16373,  16364,  16353,  16340,  16324,
231.     16305,  16284,  16261,  16235,  16207,  16176,  16143,  16107,

libavcodec/g723_1.h:229:1: Array declaration
227. 
228. /* Cosine table scaled by 2^14 */
229. static const int16_t cos_tab[COS_TBL_SIZE + 1] = {
     ^
230.     16384,  16383,  16379,  16373,  16364,  16353,  16340,  16324,
231.     16305,  16284,  16261,  16235,  16207,  16176,  16143,  16107,

libavcodec/g723_1enc.c:250:48: Array access: Offset: [-511, 511] Size: 513
248.         temp = 0;
249.         for (j = 0; j <= LPC_ORDER / 2; j++)
250.             temp += f[LPC_ORDER - 2 * j + p] * cos_tab[i * j % COS_TBL_SIZE];
                                                    ^
251.         cur_val = av_clipl_int32(temp << 1);
252. 

static void lpc2lsp(int16_t *lpc, int16_t *prev_lsp, int16_t *lsp)
{
    int f[LPC_ORDER + 2];
    int max, shift, cur_val, prev_val, count, p;
    int i, j;
    int64_t temp;
    for (i = 0; i < LPC_ORDER; i++)
        lsp[i] = (lpc[i] * bandwidth_expand[i] + (1 << 14)) >> 15;
    f[0] = f[1] = 1 << 25;
    for (i = 0; i < LPC_ORDER / 2; i++) {
        f[2 * i + 2] = -f[2 * i] - ((lsp[i] + lsp[LPC_ORDER - 1 - i]) << 12);
        f[2 * i + 3] = f[2 * i + 1] - ((lsp[i] - lsp[LPC_ORDER - 1 - i]) << 12);
    }
    f[LPC_ORDER]     >>= 1;
    f[LPC_ORDER + 1] >>= 1;
    max = FFABS(f[0]);
    for (i = 1; i < LPC_ORDER + 2; i++)
        max = FFMAX(max, FFABS(f[i]));
    shift = ff_g723_1_normalize_bits(max, 31);
    for (i = 0; i < LPC_ORDER + 2; i++)
        f[i] = av_clipl_int32((int64_t) (f[i] << shift) + (1 << 15)) >> 16;
    p    = 0;
    temp = 0;
    for (i = 0; i <= LPC_ORDER / 2; i++)
        temp += f[2 * i] * cos_tab[0];
    prev_val = av_clipl_int32(temp << 1);
    count    = 0;
    for (i = 1; i < COS_TBL_SIZE / 2; i++) {
        temp = 0;
        for (j = 0; j <= LPC_ORDER / 2; j++)
            temp += f[LPC_ORDER - 2 * j + p] * cos_tab[i * j % COS_TBL_SIZE];
        cur_val = av_clipl_int32(temp << 1);
        if ((cur_val ^ prev_val) < 0) {
            int abs_cur  = FFABS(cur_val);
            int abs_prev = FFABS(prev_val);
            int sum      = abs_cur + abs_prev;
            shift        = ff_g723_1_normalize_bits(sum, 31);
            sum        <<= shift;
            abs_prev     = abs_prev << shift >> 8;
            lsp[count++] = ((i - 1) << 7) + (abs_prev >> 1) / (sum >> 16);
            if (count == LPC_ORDER)
                break;
            p ^= 1;
            temp = 0;
            for (j = 0; j <= LPC_ORDER / 2; j++)
                temp += f[LPC_ORDER - 2 * j + p] *
                        cos_tab[i * j % COS_TBL_SIZE];
            cur_val = av_clipl_int32(temp << 1);
        }
        prev_val = cur_val;
    }
    if (count != LPC_ORDER)
        memcpy(lsp, prev_lsp, LPC_ORDER * sizeof(int16_t));
}
['static void lpc2lsp(int16_t *lpc, int16_t *prev_lsp, int16_t *lsp)\n{\n    int f[LPC_ORDER + 2];\n    int max, shift, cur_val, prev_val, count, p;\n    int i, j;\n    int64_t temp;\n    for (i = 0; i < LPC_ORDER; i++)\n        lsp[i] = (lpc[i] * bandwidth_expand[i] + (1 << 14)) >> 15;\n    f[0] = f[1] = 1 << 25;\n    for (i = 0; i < LPC_ORDER / 2; i++) {\n        f[2 * i + 2] = -f[2 * i] - ((lsp[i] + lsp[LPC_ORDER - 1 - i]) << 12);\n        f[2 * i + 3] = f[2 * i + 1] - ((lsp[i] - lsp[LPC_ORDER - 1 - i]) << 12);\n    }\n    f[LPC_ORDER]     >>= 1;\n    f[LPC_ORDER + 1] >>= 1;\n    max = FFABS(f[0]);\n    for (i = 1; i < LPC_ORDER + 2; i++)\n        max = FFMAX(max, FFABS(f[i]));\n    shift = ff_g723_1_normalize_bits(max, 31);\n    for (i = 0; i < LPC_ORDER + 2; i++)\n        f[i] = av_clipl_int32((int64_t) (f[i] << shift) + (1 << 15)) >> 16;\n    p    = 0;\n    temp = 0;\n    for (i = 0; i <= LPC_ORDER / 2; i++)\n        temp += f[2 * i] * cos_tab[0];\n    prev_val = av_clipl_int32(temp << 1);\n    count    = 0;\n    for (i = 1; i < COS_TBL_SIZE / 2; i++) {\n        temp = 0;\n        for (j = 0; j <= LPC_ORDER / 2; j++)\n            temp += f[LPC_ORDER - 2 * j + p] * cos_tab[i * j % COS_TBL_SIZE];\n        cur_val = av_clipl_int32(temp << 1);\n        if ((cur_val ^ prev_val) < 0) {\n            int abs_cur  = FFABS(cur_val);\n            int abs_prev = FFABS(prev_val);\n            int sum      = abs_cur + abs_prev;\n            shift        = ff_g723_1_normalize_bits(sum, 31);\n            sum        <<= shift;\n            abs_prev     = abs_prev << shift >> 8;\n            lsp[count++] = ((i - 1) << 7) + (abs_prev >> 1) / (sum >> 16);\n            if (count == LPC_ORDER)\n                break;\n            p ^= 1;\n            temp = 0;\n            for (j = 0; j <= LPC_ORDER / 2; j++)\n                temp += f[LPC_ORDER - 2 * j + p] *\n                        cos_tab[i * j % COS_TBL_SIZE];\n            cur_val = av_clipl_int32(temp << 1);\n        }\n        prev_val = cur_val;\n    }\n    if (count != LPC_ORDER)\n        memcpy(lsp, prev_lsp, LPC_ORDER * sizeof(int16_t));\n}']