libavcodec/nellymoserenc.c:261: error: Buffer Overrun L2
  Offset: [-35767+min(35767, `*cand`), 35767+max(1, `*cand`)] Size: 23.

libavcodec/nellymoserenc.c:249:23: <Offset trace>
247.         power_candidate = cand[band];
248.         for (q = 1000; !c && q < OPT_SIZE; q <<= 2) {
249.             idx_min = FFMAX(0, cand[band] - q);
                           ^
250.             idx_max = FFMIN(OPT_SIZE, cand[band - 1] + q);
251.             for (i = FFMAX(0, cand[band - 1] - q); i < FFMIN(OPT_SIZE, cand[band - 1] + q); i++) {

libavcodec/nellymoserenc.c:249:23: Assignment
247.         power_candidate = cand[band];
248.         for (q = 1000; !c && q < OPT_SIZE; q <<= 2) {
249.             idx_min = FFMAX(0, cand[band] - q);
                           ^
250.             idx_max = FFMIN(OPT_SIZE, cand[band - 1] + q);
251.             for (i = FFMAX(0, cand[band - 1] - q); i < FFMIN(OPT_SIZE, cand[band - 1] + q); i++) {

libavcodec/nellymoserenc.c:249:13: Assignment
247.         power_candidate = cand[band];
248.         for (q = 1000; !c && q < OPT_SIZE; q <<= 2) {
249.             idx_min = FFMAX(0, cand[band] - q);
                 ^
250.             idx_max = FFMIN(OPT_SIZE, cand[band - 1] + q);
251.             for (i = FFMAX(0, cand[band - 1] - q); i < FFMIN(OPT_SIZE, cand[band - 1] + q); i++) {

libavcodec/nellymoserenc.c:226:1: <Length trace>
224. }
225. 
226. static void get_exponent_dynamic(NellyMoserEncodeContext *s, float *cand, int *idx_table)
     ^
227. {
228.     int i, j, band, best_idx;

libavcodec/nellymoserenc.c:226:1: Parameter `(*s->opt)[*]`
224. }
225. 
226. static void get_exponent_dynamic(NellyMoserEncodeContext *s, float *cand, int *idx_table)
     ^
227. {
228.     int i, j, band, best_idx;

libavcodec/nellymoserenc.c:261:29: Array access: Offset: [-35767+min(35767, *cand), 35767+max(1, *cand)] Size: 23
259.                         tmp = opt[band - 1][i] + distance(idx, power_candidate, band);
260.                         if (opt[band][idx] > tmp) {
261.                             opt[band][idx] = tmp;
                                 ^
262.                             path[band][idx] = j;
263.                             c = 1;

static void get_exponent_dynamic(NellyMoserEncodeContext *s, float *cand, int *idx_table)
{
    int i, j, band, best_idx;
    float power_candidate, best_val;
    float  (*opt )[NELLY_BANDS] = s->opt ;
    uint8_t(*path)[NELLY_BANDS] = s->path;
    for (i = 0; i < NELLY_BANDS * OPT_SIZE; i++) {
        opt[0][i] = INFINITY;
    }
    for (i = 0; i < 64; i++) {
        opt[0][ff_nelly_init_table[i]] = distance(cand[0], ff_nelly_init_table[i], 0);
        path[0][ff_nelly_init_table[i]] = i;
    }
    for (band = 1; band < NELLY_BANDS; band++) {
        int q, c = 0;
        float tmp;
        int idx_min, idx_max, idx;
        power_candidate = cand[band];
        for (q = 1000; !c && q < OPT_SIZE; q <<= 2) {
            idx_min = FFMAX(0, cand[band] - q);
            idx_max = FFMIN(OPT_SIZE, cand[band - 1] + q);
            for (i = FFMAX(0, cand[band - 1] - q); i < FFMIN(OPT_SIZE, cand[band - 1] + q); i++) {
                if ( isinf(opt[band - 1][i]) )
                    continue;
                for (j = 0; j < 32; j++) {
                    idx = i + ff_nelly_delta_table[j];
                    if (idx > idx_max)
                        break;
                    if (idx >= idx_min) {
                        tmp = opt[band - 1][i] + distance(idx, power_candidate, band);
                        if (opt[band][idx] > tmp) {
                            opt[band][idx] = tmp;
                            path[band][idx] = j;
                            c = 1;
                        }
                    }
                }
            }
        }
        assert(c);
    }
    best_val = INFINITY;
    best_idx = -1;
    band = NELLY_BANDS - 1;
    for (i = 0; i < OPT_SIZE; i++) {
        if (best_val > opt[band][i]) {
            best_val = opt[band][i];
            best_idx = i;
        }
    }
    for (band = NELLY_BANDS - 1; band >= 0; band--) {
        idx_table[band] = path[band][best_idx];
        if (band) {
            best_idx -= ff_nelly_delta_table[path[band][best_idx]];
        }
    }
}
['static void get_exponent_dynamic(NellyMoserEncodeContext *s, float *cand, int *idx_table)\n{\n    int i, j, band, best_idx;\n    float power_candidate, best_val;\n    float  (*opt )[NELLY_BANDS] = s->opt ;\n    uint8_t(*path)[NELLY_BANDS] = s->path;\n    for (i = 0; i < NELLY_BANDS * OPT_SIZE; i++) {\n        opt[0][i] = INFINITY;\n    }\n    for (i = 0; i < 64; i++) {\n        opt[0][ff_nelly_init_table[i]] = distance(cand[0], ff_nelly_init_table[i], 0);\n        path[0][ff_nelly_init_table[i]] = i;\n    }\n    for (band = 1; band < NELLY_BANDS; band++) {\n        int q, c = 0;\n        float tmp;\n        int idx_min, idx_max, idx;\n        power_candidate = cand[band];\n        for (q = 1000; !c && q < OPT_SIZE; q <<= 2) {\n            idx_min = FFMAX(0, cand[band] - q);\n            idx_max = FFMIN(OPT_SIZE, cand[band - 1] + q);\n            for (i = FFMAX(0, cand[band - 1] - q); i < FFMIN(OPT_SIZE, cand[band - 1] + q); i++) {\n                if ( isinf(opt[band - 1][i]) )\n                    continue;\n                for (j = 0; j < 32; j++) {\n                    idx = i + ff_nelly_delta_table[j];\n                    if (idx > idx_max)\n                        break;\n                    if (idx >= idx_min) {\n                        tmp = opt[band - 1][i] + distance(idx, power_candidate, band);\n                        if (opt[band][idx] > tmp) {\n                            opt[band][idx] = tmp;\n                            path[band][idx] = j;\n                            c = 1;\n                        }\n                    }\n                }\n            }\n        }\n        assert(c);\n    }\n    best_val = INFINITY;\n    best_idx = -1;\n    band = NELLY_BANDS - 1;\n    for (i = 0; i < OPT_SIZE; i++) {\n        if (best_val > opt[band][i]) {\n            best_val = opt[band][i];\n            best_idx = i;\n        }\n    }\n    for (band = NELLY_BANDS - 1; band >= 0; band--) {\n        idx_table[band] = path[band][best_idx];\n        if (band) {\n            best_idx -= ff_nelly_delta_table[path[band][best_idx]];\n        }\n    }\n}']