libavcodec/vorbisdec.c:350: error: Integer Overflow L2
  ([0, +oo] - 1):unsigned32 by call to `ff_vorbis_nth_root`.

libavcodec/vorbisdec.c:341:39: Call
339.         }
340. 
341.         codebook_setup->lookup_type = get_bits(gb, 4);
                                           ^
342. 
343.         av_dlog(NULL, " lookup type: %d : %s \n", codebook_setup->lookup_type,

libavcodec/get_bits.h:277:5: Call
  275.     register int tmp;
  276.     OPEN_READER(re, s);
  277.     UPDATE_CACHE(re, s);
           ^
  278.     tmp = SHOW_UBITS(re, s, n);
  279.     LAST_SKIP_BITS(re, s, n);

libavutil/bswap.h:66:1: Parameter `x`
    64. 
    65. #ifndef av_bswap32
    66. static av_always_inline av_const uint32_t av_bswap32(uint32_t x)
        ^
    67. {
    68.     return AV_BSWAP32C(x);

libavutil/bswap.h:68:5: Assignment
    66. static av_always_inline av_const uint32_t av_bswap32(uint32_t x)
    67. {
    68.     return AV_BSWAP32C(x);
            ^
    69. }
    70. #endif

libavcodec/get_bits.h:277:5: Assignment
  275.     register int tmp;
  276.     OPEN_READER(re, s);
  277.     UPDATE_CACHE(re, s);
           ^
  278.     tmp = SHOW_UBITS(re, s, n);
  279.     LAST_SKIP_BITS(re, s, n);

libavcodec/get_bits.h:278:5: Assignment
  276.     OPEN_READER(re, s);
  277.     UPDATE_CACHE(re, s);
  278.     tmp = SHOW_UBITS(re, s, n);
           ^
  279.     LAST_SKIP_BITS(re, s, n);
  280.     CLOSE_READER(re, s);

libavcodec/get_bits.h:281:5: Assignment
  279.     LAST_SKIP_BITS(re, s, n);
  280.     CLOSE_READER(re, s);
  281.     return tmp;
           ^
  282. }
  283. 

libavcodec/vorbisdec.c:341:9: Assignment
339.         }
340. 
341.         codebook_setup->lookup_type = get_bits(gb, 4);
             ^
342. 
343.         av_dlog(NULL, " lookup type: %d : %s \n", codebook_setup->lookup_type,

libavcodec/vorbisdec.c:350:47: Call
348.         if (codebook_setup->lookup_type == 1) {
349.             unsigned i, j, k;
350.             unsigned codebook_lookup_values = ff_vorbis_nth_root(entries, codebook_setup->dimensions);
                                                   ^
351. 
352.             float codebook_minimum_value = vorbisfloat2float(get_bits_long(gb, 32));

libavcodec/vorbis.c:35:1: <LHS trace>
33. 
34. // x^(1/n)
35. unsigned int ff_vorbis_nth_root(unsigned int x, unsigned int n)
    ^
36. {
37.     unsigned int ret = 0, i, j;

libavcodec/vorbis.c:35:1: Parameter `n`
  33. 
  34. // x^(1/n)
  35. unsigned int ff_vorbis_nth_root(unsigned int x, unsigned int n)
      ^
  36. {
  37.     unsigned int ret = 0, i, j;

libavcodec/vorbis.c:41:30: Binary operation: ([0, +oo] - 1):unsigned32 by call to `ff_vorbis_nth_root` 
  39.     do {
  40.         ++ret;
  41.         for (i = 0, j = ret; i < n - 1; i++)
                                   ^
  42.             j *= ret;
  43.     } while (j <= x);

unsigned int ff_vorbis_nth_root(unsigned int x, unsigned int n)
{
    unsigned int ret = 0, i, j;
    do {
        ++ret;
        for (i = 0, j = ret; i < n - 1; i++)
            j *= ret;
    } while (j <= x);
    return ret - 1;
}
['static int vorbis_parse_setup_hdr_codebooks(vorbis_context *vc)\n{\n    unsigned cb;\n    uint8_t  *tmp_vlc_bits;\n    uint32_t *tmp_vlc_codes;\n    GetBitContext *gb = &vc->gb;\n    uint16_t *codebook_multiplicands;\n    int ret = 0;\n    vc->codebook_count = get_bits(gb, 8) + 1;\n    av_dlog(NULL, " Codebooks: %d \\n", vc->codebook_count);\n    vc->codebooks = av_mallocz(vc->codebook_count * sizeof(*vc->codebooks));\n    tmp_vlc_bits  = av_mallocz(V_MAX_VLCS * sizeof(*tmp_vlc_bits));\n    tmp_vlc_codes = av_mallocz(V_MAX_VLCS * sizeof(*tmp_vlc_codes));\n    codebook_multiplicands = av_malloc(V_MAX_VLCS * sizeof(*codebook_multiplicands));\n    for (cb = 0; cb < vc->codebook_count; ++cb) {\n        vorbis_codebook *codebook_setup = &vc->codebooks[cb];\n        unsigned ordered, t, entries, used_entries = 0;\n        av_dlog(NULL, " %u. Codebook\\n", cb);\n        if (get_bits(gb, 24) != 0x564342) {\n            av_log(vc->avccontext, AV_LOG_ERROR,\n                   " %u. Codebook setup data corrupt.\\n", cb);\n            ret = AVERROR_INVALIDDATA;\n            goto error;\n        }\n        codebook_setup->dimensions=get_bits(gb, 16);\n        if (codebook_setup->dimensions > 16 || codebook_setup->dimensions == 0) {\n            av_log(vc->avccontext, AV_LOG_ERROR,\n                   " %u. Codebook\'s dimension is invalid (%d).\\n",\n                   cb, codebook_setup->dimensions);\n            ret = AVERROR_INVALIDDATA;\n            goto error;\n        }\n        entries = get_bits(gb, 24);\n        if (entries > V_MAX_VLCS) {\n            av_log(vc->avccontext, AV_LOG_ERROR,\n                   " %u. Codebook has too many entries (%u).\\n",\n                   cb, entries);\n            ret = AVERROR_INVALIDDATA;\n            goto error;\n        }\n        ordered = get_bits1(gb);\n        av_dlog(NULL, " codebook_dimensions %d, codebook_entries %u\\n",\n                codebook_setup->dimensions, entries);\n        if (!ordered) {\n            unsigned ce, flag;\n            unsigned sparse = get_bits1(gb);\n            av_dlog(NULL, " not ordered \\n");\n            if (sparse) {\n                av_dlog(NULL, " sparse \\n");\n                used_entries = 0;\n                for (ce = 0; ce < entries; ++ce) {\n                    flag = get_bits1(gb);\n                    if (flag) {\n                        tmp_vlc_bits[ce] = get_bits(gb, 5) + 1;\n                        ++used_entries;\n                    } else\n                        tmp_vlc_bits[ce] = 0;\n                }\n            } else {\n                av_dlog(NULL, " not sparse \\n");\n                used_entries = entries;\n                for (ce = 0; ce < entries; ++ce)\n                    tmp_vlc_bits[ce] = get_bits(gb, 5) + 1;\n            }\n        } else {\n            unsigned current_entry  = 0;\n            unsigned current_length = get_bits(gb, 5) + 1;\n            av_dlog(NULL, " ordered, current length: %u\\n", current_length);\n            used_entries = entries;\n            for (; current_entry < used_entries && current_length <= 32; ++current_length) {\n                unsigned i, number;\n                av_dlog(NULL, " number bits: %u ", ilog(entries - current_entry));\n                number = get_bits(gb, ilog(entries - current_entry));\n                av_dlog(NULL, " number: %u\\n", number);\n                for (i = current_entry; i < number+current_entry; ++i)\n                    if (i < used_entries)\n                        tmp_vlc_bits[i] = current_length;\n                current_entry+=number;\n            }\n            if (current_entry>used_entries) {\n                av_log(vc->avccontext, AV_LOG_ERROR, " More codelengths than codes in codebook. \\n");\n                ret = AVERROR_INVALIDDATA;\n                goto error;\n            }\n        }\n        codebook_setup->lookup_type = get_bits(gb, 4);\n        av_dlog(NULL, " lookup type: %d : %s \\n", codebook_setup->lookup_type,\n                codebook_setup->lookup_type ? "vq" : "no lookup");\n        if (codebook_setup->lookup_type == 1) {\n            unsigned i, j, k;\n            unsigned codebook_lookup_values = ff_vorbis_nth_root(entries, codebook_setup->dimensions);\n            float codebook_minimum_value = vorbisfloat2float(get_bits_long(gb, 32));\n            float codebook_delta_value   = vorbisfloat2float(get_bits_long(gb, 32));\n            unsigned codebook_value_bits = get_bits(gb, 4) + 1;\n            unsigned codebook_sequence_p = get_bits1(gb);\n            av_dlog(NULL, " We expect %d numbers for building the codevectors. \\n",\n                    codebook_lookup_values);\n            av_dlog(NULL, "  delta %f minmum %f \\n",\n                    codebook_delta_value, codebook_minimum_value);\n            for (i = 0; i < codebook_lookup_values; ++i) {\n                codebook_multiplicands[i] = get_bits(gb, codebook_value_bits);\n                av_dlog(NULL, " multiplicands*delta+minmum : %e \\n",\n                        (float)codebook_multiplicands[i] * codebook_delta_value + codebook_minimum_value);\n                av_dlog(NULL, " multiplicand %u\\n", codebook_multiplicands[i]);\n            }\n            codebook_setup->codevectors = used_entries ? av_mallocz(used_entries *\n                                                                    codebook_setup->dimensions *\n                                                                    sizeof(*codebook_setup->codevectors))\n                                                       : NULL;\n            for (j = 0, i = 0; i < entries; ++i) {\n                unsigned dim = codebook_setup->dimensions;\n                if (tmp_vlc_bits[i]) {\n                    float last = 0.0;\n                    unsigned lookup_offset = i;\n                    av_dlog(vc->avccontext, "Lookup offset %u ,", i);\n                    for (k = 0; k < dim; ++k) {\n                        unsigned multiplicand_offset = lookup_offset % codebook_lookup_values;\n                        codebook_setup->codevectors[j * dim + k] = codebook_multiplicands[multiplicand_offset] * codebook_delta_value + codebook_minimum_value + last;\n                        if (codebook_sequence_p)\n                            last = codebook_setup->codevectors[j * dim + k];\n                        lookup_offset/=codebook_lookup_values;\n                    }\n                    tmp_vlc_bits[j] = tmp_vlc_bits[i];\n                    av_dlog(vc->avccontext, "real lookup offset %u, vector: ", j);\n                    for (k = 0; k < dim; ++k)\n                        av_dlog(vc->avccontext, " %f ",\n                                codebook_setup->codevectors[j * dim + k]);\n                    av_dlog(vc->avccontext, "\\n");\n                    ++j;\n                }\n            }\n            if (j != used_entries) {\n                av_log(vc->avccontext, AV_LOG_ERROR, "Bug in codevector vector building code. \\n");\n                ret = AVERROR_INVALIDDATA;\n                goto error;\n            }\n            entries = used_entries;\n        } else if (codebook_setup->lookup_type >= 2) {\n            av_log(vc->avccontext, AV_LOG_ERROR, "Codebook lookup type not supported. \\n");\n            ret = AVERROR_INVALIDDATA;\n            goto error;\n        }\n        if (ff_vorbis_len2vlc(tmp_vlc_bits, tmp_vlc_codes, entries)) {\n            av_log(vc->avccontext, AV_LOG_ERROR, " Invalid code lengths while generating vlcs. \\n");\n            ret = AVERROR_INVALIDDATA;\n            goto error;\n        }\n        codebook_setup->maxdepth = 0;\n        for (t = 0; t < entries; ++t)\n            if (tmp_vlc_bits[t] >= codebook_setup->maxdepth)\n                codebook_setup->maxdepth = tmp_vlc_bits[t];\n        if (codebook_setup->maxdepth > 3 * V_NB_BITS)\n            codebook_setup->nb_bits = V_NB_BITS2;\n        else\n            codebook_setup->nb_bits = V_NB_BITS;\n        codebook_setup->maxdepth = (codebook_setup->maxdepth+codebook_setup->nb_bits - 1) / codebook_setup->nb_bits;\n        if ((ret = init_vlc(&codebook_setup->vlc, codebook_setup->nb_bits,\n                            entries, tmp_vlc_bits, sizeof(*tmp_vlc_bits),\n                            sizeof(*tmp_vlc_bits), tmp_vlc_codes,\n                            sizeof(*tmp_vlc_codes), sizeof(*tmp_vlc_codes),\n                            INIT_VLC_LE))) {\n            av_log(vc->avccontext, AV_LOG_ERROR, " Error generating vlc tables. \\n");\n            goto error;\n        }\n    }\n    av_free(tmp_vlc_bits);\n    av_free(tmp_vlc_codes);\n    av_free(codebook_multiplicands);\n    return 0;\nerror:\n    av_free(tmp_vlc_bits);\n    av_free(tmp_vlc_codes);\n    av_free(codebook_multiplicands);\n    return ret;\n}', 'static inline unsigned int get_bits(GetBitContext *s, int n){\n    register int tmp;\n    OPEN_READER(re, s);\n    UPDATE_CACHE(re, s);\n    tmp = SHOW_UBITS(re, s, n);\n    LAST_SKIP_BITS(re, s, n);\n    CLOSE_READER(re, s);\n    return tmp;\n}', 'static av_always_inline av_const uint32_t av_bswap32(uint32_t x)\n{\n    return AV_BSWAP32C(x);\n}', 'unsigned int ff_vorbis_nth_root(unsigned int x, unsigned int n)\n{\n    unsigned int ret = 0, i, j;\n    do {\n        ++ret;\n        for (i = 0, j = ret; i < n - 1; i++)\n            j *= ret;\n    } while (j <= x);\n    return ret - 1;\n}']