libavcodec/vorbis_enc.c:951: error: Integer Overflow L2
  ([0, +oo] - 1):unsigned64 by call to `floor_encode`.

libavcodec/vorbis_enc.c:950:9: Call
948.         vorbis_enc_floor * fc = &venc->floors[mapping->floor[mapping->mux[i]]];
949.         uint_fast16_t posts[fc->values];
950.         floor_fit(venc, fc, &venc->coeffs[i * samples], posts, samples);
             ^
951.         floor_encode(venc, fc, &pb, posts, &venc->floor[i * samples], samples);
952.     }

libavcodec/vorbis_enc.c:638:1: Parameter `*posts`
  636. }
  637. 
  638. static void floor_fit(vorbis_enc_context * venc, vorbis_enc_floor * fc, float * coeffs, uint_fast16_t * posts, int samples) {
       ^
  639.     int range = 255 / fc->multiplier + 1;
  640.     int i;

libavcodec/vorbis_enc.c:951:9: Call
949.         uint_fast16_t posts[fc->values];
950.         floor_fit(venc, fc, &venc->coeffs[i * samples], posts, samples);
951.         floor_encode(venc, fc, &pb, posts, &venc->floor[i * samples], samples);
             ^
952.     }
953. 

libavcodec/vorbis_enc.c:666:1: <LHS trace>
664. }
665. 
666. static void floor_encode(vorbis_enc_context * venc, vorbis_enc_floor * fc, PutBitContext * pb, uint_fast16_t * posts, float * floor, int samples) {
     ^
667.     int range = 255 / fc->multiplier + 1;
668.     int coded[fc->values]; // first 2 values are unused

libavcodec/vorbis_enc.c:666:1: Parameter `*posts`
  664. }
  665. 
  666. static void floor_encode(vorbis_enc_context * venc, vorbis_enc_floor * fc, PutBitContext * pb, uint_fast16_t * posts, float * floor, int samples) {
       ^
  667.     int range = 255 / fc->multiplier + 1;
  668.     int coded[fc->values]; // first 2 values are unused

libavcodec/vorbis_enc.c:701:17: Binary operation: ([0, +oo] - 1):unsigned64 by call to `floor_encode` 
  699.                 coded[i] = predicted - posts[i] + highroom - 1;
  700.             else
  701.                 coded[i] = ((predicted - posts[i]) << 1) - 1;
                       ^
  702.         }
  703.     }

static void floor_encode(vorbis_enc_context * venc, vorbis_enc_floor * fc, PutBitContext * pb, uint_fast16_t * posts, float * floor, int samples) {
    int range = 255 / fc->multiplier + 1;
    int coded[fc->values];
    int i, counter;
    put_bits(pb, 1, 1);
    put_bits(pb, ilog(range - 1), posts[0]);
    put_bits(pb, ilog(range - 1), posts[1]);
    coded[0] = coded[1] = 1;
    for (i = 2; i < fc->values; i++) {
        int predicted = render_point(fc->list[fc->list[i].low].x,
                                     posts[fc->list[i].low],
                                     fc->list[fc->list[i].high].x,
                                     posts[fc->list[i].high],
                                     fc->list[i].x);
        int highroom = range - predicted;
        int lowroom = predicted;
        int room = FFMIN(highroom, lowroom);
        if (predicted == posts[i]) {
            coded[i] = 0;
            continue;
        } else {
            if (!coded[fc->list[i].low ]) coded[fc->list[i].low ] = -1;
            if (!coded[fc->list[i].high]) coded[fc->list[i].high] = -1;
        }
        if (posts[i] > predicted) {
            if (posts[i] - predicted > room)
                coded[i] = posts[i] - predicted + lowroom;
            else
                coded[i] = (posts[i] - predicted) << 1;
        } else {
            if (predicted - posts[i] > room)
                coded[i] = predicted - posts[i] + highroom - 1;
            else
                coded[i] = ((predicted - posts[i]) << 1) - 1;
        }
    }
    counter = 2;
    for (i = 0; i < fc->partitions; i++) {
        vorbis_enc_floor_class * c = &fc->classes[fc->partition_to_class[i]];
        int k, cval = 0, csub = 1<<c->subclass;
        if (c->subclass) {
            vorbis_enc_codebook * book = &venc->codebooks[c->masterbook];
            int cshift = 0;
            for (k = 0; k < c->dim; k++) {
                int l;
                for (l = 0; l < csub; l++) {
                    int maxval = 1;
                    if (c->books[l] != -1)
                        maxval = venc->codebooks[c->books[l]].nentries;
                    if (coded[counter + k] < maxval) break;
                }
                assert(l != csub);
                cval |= l << cshift;
                cshift += c->subclass;
            }
            put_codeword(pb, book, cval);
        }
        for (k = 0; k < c->dim; k++) {
            int book = c->books[cval & (csub-1)];
            int entry = coded[counter++];
            cval >>= c->subclass;
            if (book == -1) continue;
            if (entry == -1) entry = 0;
            put_codeword(pb, &venc->codebooks[book], entry);
        }
    }
    ff_vorbis_floor1_render_list(fc->list, fc->values, posts, coded, fc->multiplier, floor, samples);
}
['static int vorbis_encode_frame(AVCodecContext * avccontext, unsigned char * packets, int buf_size, void *data)\n{\n    vorbis_enc_context * venc = avccontext->priv_data;\n    signed short * audio = data;\n    int samples = data ? avccontext->frame_size : 0;\n    vorbis_enc_mode * mode;\n    vorbis_enc_mapping * mapping;\n    PutBitContext pb;\n    int i;\n    if (!apply_window_and_mdct(venc, audio, samples)) return 0;\n    samples = 1 << (venc->log2_blocksize[0] - 1);\n    init_put_bits(&pb, packets, buf_size);\n    put_bits(&pb, 1, 0);\n    put_bits(&pb, ilog(venc->nmodes - 1), 0);\n    mode = &venc->modes[0];\n    mapping = &venc->mappings[mode->mapping];\n    if (mode->blockflag) {\n        put_bits(&pb, 1, 0);\n        put_bits(&pb, 1, 0);\n    }\n    for (i = 0; i < venc->channels; i++) {\n        vorbis_enc_floor * fc = &venc->floors[mapping->floor[mapping->mux[i]]];\n        uint_fast16_t posts[fc->values];\n        floor_fit(venc, fc, &venc->coeffs[i * samples], posts, samples);\n        floor_encode(venc, fc, &pb, posts, &venc->floor[i * samples], samples);\n    }\n    for (i = 0; i < venc->channels * samples; i++) {\n        venc->coeffs[i] /= venc->floor[i];\n    }\n    for (i = 0; i < mapping->coupling_steps; i++) {\n        float * mag = venc->coeffs + mapping->magnitude[i] * samples;\n        float * ang = venc->coeffs + mapping->angle[i] * samples;\n        int j;\n        for (j = 0; j < samples; j++) {\n            float a = ang[j];\n            ang[j] -= mag[j];\n            if (mag[j] > 0) ang[j] = -ang[j];\n            if (ang[j] < 0) mag[j] = a;\n        }\n    }\n    residue_encode(venc, &venc->residues[mapping->residue[mapping->mux[0]]], &pb, venc->coeffs, samples, venc->channels);\n    avccontext->coded_frame->pts = venc->sample_count;\n    venc->sample_count += avccontext->frame_size;\n    flush_put_bits(&pb);\n    return (put_bits_count(&pb) + 7) / 8;\n}', 'static void floor_fit(vorbis_enc_context * venc, vorbis_enc_floor * fc, float * coeffs, uint_fast16_t * posts, int samples) {\n    int range = 255 / fc->multiplier + 1;\n    int i;\n    float tot_average = 0.;\n    float averages[fc->values];\n    for (i = 0; i < fc->values; i++){\n        averages[i] = get_floor_average(fc, coeffs, i);\n        tot_average += averages[i];\n    }\n    tot_average /= fc->values;\n    tot_average /= venc->quality;\n    for (i = 0; i < fc->values; i++) {\n        int position = fc->list[fc->list[i].sort].x;\n        float average = averages[i];\n        int j;\n        average *= pow(tot_average / average, 0.5) * pow(1.25, position/200.);\n        for (j = 0; j < range - 1; j++)\n            if (ff_vorbis_floor1_inverse_db_table[j * fc->multiplier] > average) break;\n        posts[fc->list[i].sort] = j;\n    }\n}', 'static void floor_encode(vorbis_enc_context * venc, vorbis_enc_floor * fc, PutBitContext * pb, uint_fast16_t * posts, float * floor, int samples) {\n    int range = 255 / fc->multiplier + 1;\n    int coded[fc->values];\n    int i, counter;\n    put_bits(pb, 1, 1);\n    put_bits(pb, ilog(range - 1), posts[0]);\n    put_bits(pb, ilog(range - 1), posts[1]);\n    coded[0] = coded[1] = 1;\n    for (i = 2; i < fc->values; i++) {\n        int predicted = render_point(fc->list[fc->list[i].low].x,\n                                     posts[fc->list[i].low],\n                                     fc->list[fc->list[i].high].x,\n                                     posts[fc->list[i].high],\n                                     fc->list[i].x);\n        int highroom = range - predicted;\n        int lowroom = predicted;\n        int room = FFMIN(highroom, lowroom);\n        if (predicted == posts[i]) {\n            coded[i] = 0;\n            continue;\n        } else {\n            if (!coded[fc->list[i].low ]) coded[fc->list[i].low ] = -1;\n            if (!coded[fc->list[i].high]) coded[fc->list[i].high] = -1;\n        }\n        if (posts[i] > predicted) {\n            if (posts[i] - predicted > room)\n                coded[i] = posts[i] - predicted + lowroom;\n            else\n                coded[i] = (posts[i] - predicted) << 1;\n        } else {\n            if (predicted - posts[i] > room)\n                coded[i] = predicted - posts[i] + highroom - 1;\n            else\n                coded[i] = ((predicted - posts[i]) << 1) - 1;\n        }\n    }\n    counter = 2;\n    for (i = 0; i < fc->partitions; i++) {\n        vorbis_enc_floor_class * c = &fc->classes[fc->partition_to_class[i]];\n        int k, cval = 0, csub = 1<<c->subclass;\n        if (c->subclass) {\n            vorbis_enc_codebook * book = &venc->codebooks[c->masterbook];\n            int cshift = 0;\n            for (k = 0; k < c->dim; k++) {\n                int l;\n                for (l = 0; l < csub; l++) {\n                    int maxval = 1;\n                    if (c->books[l] != -1)\n                        maxval = venc->codebooks[c->books[l]].nentries;\n                    if (coded[counter + k] < maxval) break;\n                }\n                assert(l != csub);\n                cval |= l << cshift;\n                cshift += c->subclass;\n            }\n            put_codeword(pb, book, cval);\n        }\n        for (k = 0; k < c->dim; k++) {\n            int book = c->books[cval & (csub-1)];\n            int entry = coded[counter++];\n            cval >>= c->subclass;\n            if (book == -1) continue;\n            if (entry == -1) entry = 0;\n            put_codeword(pb, &venc->codebooks[book], entry);\n        }\n    }\n    ff_vorbis_floor1_render_list(fc->list, fc->values, posts, coded, fc->multiplier, floor, samples);\n}']