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

libavcodec/vorbis_dec.c:336:39: Call
334.         }
335. 
336.         codebook_setup->lookup_type = get_bits(gb, 4);
                                           ^
337. 
338.         AV_DEBUG(" lookup type: %d : %s \n", codebook_setup->lookup_type, codebook_setup->lookup_type ? "vq" : "no lookup");

libavcodec/get_bits.h:365:5: Call
  363.     register int tmp;
  364.     OPEN_READER(re, s)
  365.     UPDATE_CACHE(re, s)
           ^
  366.     tmp= SHOW_UBITS(re, s, n);
  367.     LAST_SKIP_BITS(re, s, n)

libavutil/bswap.h:60:1: Parameter `x`
    58. 
    59. #ifndef bswap_32
    60. static av_always_inline av_const uint32_t bswap_32(uint32_t x)
        ^
    61. {
    62.     x= ((x<<8)&0xFF00FF00) | ((x>>8)&0x00FF00FF);

libavutil/bswap.h:62:5: Assignment
    60. static av_always_inline av_const uint32_t bswap_32(uint32_t x)
    61. {
    62.     x= ((x<<8)&0xFF00FF00) | ((x>>8)&0x00FF00FF);
            ^
    63.     x= (x>>16) | (x<<16);
    64.     return x;

libavutil/bswap.h:63:5: Assignment
    61. {
    62.     x= ((x<<8)&0xFF00FF00) | ((x>>8)&0x00FF00FF);
    63.     x= (x>>16) | (x<<16);
            ^
    64.     return x;
    65. }

libavutil/bswap.h:64:5: Assignment
    62.     x= ((x<<8)&0xFF00FF00) | ((x>>8)&0x00FF00FF);
    63.     x= (x>>16) | (x<<16);
    64.     return x;
            ^
    65. }
    66. #endif

libavcodec/get_bits.h:365:5: Assignment
  363.     register int tmp;
  364.     OPEN_READER(re, s)
  365.     UPDATE_CACHE(re, s)
           ^
  366.     tmp= SHOW_UBITS(re, s, n);
  367.     LAST_SKIP_BITS(re, s, n)

libavcodec/get_bits.h:366:5: Assignment
  364.     OPEN_READER(re, s)
  365.     UPDATE_CACHE(re, s)
  366.     tmp= SHOW_UBITS(re, s, n);
           ^
  367.     LAST_SKIP_BITS(re, s, n)
  368.     CLOSE_READER(re, s)

libavcodec/get_bits.h:369:5: Assignment
  367.     LAST_SKIP_BITS(re, s, n)
  368.     CLOSE_READER(re, s)
  369.     return tmp;
           ^
  370. }
  371. 

libavcodec/vorbis_dec.c:336:9: Assignment
334.         }
335. 
336.         codebook_setup->lookup_type = get_bits(gb, 4);
             ^
337. 
338.         AV_DEBUG(" lookup type: %d : %s \n", codebook_setup->lookup_type, codebook_setup->lookup_type ? "vq" : "no lookup");

libavcodec/vorbis_dec.c:344:52: Call
342.         if (codebook_setup->lookup_type == 1) {
343.             uint_fast16_t i, j, k;
344.             uint_fast16_t codebook_lookup_values = ff_vorbis_nth_root(entries, codebook_setup->dimensions);
                                                        ^
345. 
346.             float codebook_minimum_value = vorbisfloat2float(get_bits_long(gb, 32));

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

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

libavcodec/vorbis.c:42:30: Binary operation: ([0, +oo] - 1):unsigned32 by call to `ff_vorbis_nth_root` 
  40.     do {
  41.         ++ret;
  42.         for (i = 0, j = ret; i < n - 1; i++)
                                   ^
  43.             j *= ret;
  44.     } 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    uint_fast16_t cb;\n    uint8_t  *tmp_vlc_bits;\n    uint32_t *tmp_vlc_codes;\n    GetBitContext *gb = &vc->gb;\n    uint_fast16_t *codebook_multiplicands;\n    vc->codebook_count = get_bits(gb, 8) + 1;\n    AV_DEBUG(" Codebooks: %d \\n", vc->codebook_count);\n    vc->codebooks = av_mallocz(vc->codebook_count * sizeof(vorbis_codebook));\n    tmp_vlc_bits  = av_mallocz(V_MAX_VLCS * sizeof(uint8_t));\n    tmp_vlc_codes = av_mallocz(V_MAX_VLCS * sizeof(uint32_t));\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        uint_fast8_t ordered;\n        uint_fast32_t t, used_entries = 0;\n        uint_fast32_t entries;\n        AV_DEBUG(" %d. Codebook \\n", cb);\n        if (get_bits(gb, 24) != 0x564342) {\n            av_log(vc->avccontext, AV_LOG_ERROR, " %"PRIdFAST16". Codebook setup data corrupt. \\n", cb);\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, " %"PRIdFAST16". Codebook\'s dimension is invalid (%d). \\n", cb, codebook_setup->dimensions);\n            goto error;\n        }\n        entries = get_bits(gb, 24);\n        if (entries > V_MAX_VLCS) {\n            av_log(vc->avccontext, AV_LOG_ERROR, " %"PRIdFAST16". Codebook has too many entries (%"PRIdFAST32"). \\n", cb, entries);\n            goto error;\n        }\n        ordered = get_bits1(gb);\n        AV_DEBUG(" codebook_dimensions %d, codebook_entries %d \\n", codebook_setup->dimensions, entries);\n        if (!ordered) {\n            uint_fast16_t ce;\n            uint_fast8_t  flag;\n            uint_fast8_t  sparse = get_bits1(gb);\n            AV_DEBUG(" not ordered \\n");\n            if (sparse) {\n                AV_DEBUG(" 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_DEBUG(" 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            uint_fast16_t current_entry = 0;\n            uint_fast8_t current_length = get_bits(gb, 5)+1;\n            AV_DEBUG(" ordered, current length: %d \\n", current_length);\n            used_entries = entries;\n            for (; current_entry < used_entries && current_length <= 32; ++current_length) {\n                uint_fast16_t i, number;\n                AV_DEBUG(" number bits: %d ", ilog(entries - current_entry));\n                number = get_bits(gb, ilog(entries - current_entry));\n                AV_DEBUG(" number: %d \\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                goto error;\n            }\n        }\n        codebook_setup->lookup_type = get_bits(gb, 4);\n        AV_DEBUG(" lookup type: %d : %s \\n", codebook_setup->lookup_type, codebook_setup->lookup_type ? "vq" : "no lookup");\n        if (codebook_setup->lookup_type == 1) {\n            uint_fast16_t i, j, k;\n            uint_fast16_t 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            uint_fast8_t codebook_value_bits = get_bits(gb, 4)+1;\n            uint_fast8_t codebook_sequence_p = get_bits1(gb);\n            AV_DEBUG(" We expect %d numbers for building the codevectors. \\n", codebook_lookup_values);\n            AV_DEBUG("  delta %f minmum %f \\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_DEBUG(" multiplicands*delta+minmum : %e \\n", (float)codebook_multiplicands[i]*codebook_delta_value+codebook_minimum_value);\n                AV_DEBUG(" multiplicand %d \\n", codebook_multiplicands[i]);\n            }\n            codebook_setup->codevectors = used_entries ? av_mallocz(used_entries*codebook_setup->dimensions * sizeof(float)) : NULL;\n            for (j = 0, i = 0; i < entries; ++i) {\n                uint_fast8_t dim = codebook_setup->dimensions;\n                if (tmp_vlc_bits[i]) {\n                    float last = 0.0;\n                    uint_fast32_t lookup_offset = i;\n#ifdef V_DEBUG\n                    av_log(vc->avccontext, AV_LOG_INFO, "Lookup offset %d ,", i);\n#endif\n                    for (k = 0; k < dim; ++k) {\n                        uint_fast32_t 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#ifdef V_DEBUG\n                    av_log(vc->avccontext, AV_LOG_INFO, "real lookup offset %d, vector: ", j);\n                    for (k = 0; k < dim; ++k)\n                        av_log(vc->avccontext, AV_LOG_INFO, " %f ", codebook_setup->codevectors[j * dim + k]);\n                    av_log(vc->avccontext, AV_LOG_INFO, "\\n");\n#endif\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                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            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            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 (init_vlc(&codebook_setup->vlc, codebook_setup->nb_bits, entries, tmp_vlc_bits, sizeof(*tmp_vlc_bits), sizeof(*tmp_vlc_bits), tmp_vlc_codes, sizeof(*tmp_vlc_codes), sizeof(*tmp_vlc_codes), 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 -1;\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 bswap_32(uint32_t x)\n{\n    x= ((x<<8)&0xFF00FF00) | ((x>>8)&0x00FF00FF);\n    x= (x>>16) | (x<<16);\n    return 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}']