libavcodec/eac3dec.c:158: error: Integer Overflow L2
  ([0, 8388607] - 4194304):unsigned32.

libavcodec/eac3dec.c:112:1: <LHS trace>
110. }
111. 
112. void ff_eac3_decode_transform_coeffs_aht_ch(AC3DecodeContext *s, int ch)
     ^
113. {
114.     int bin, blk, gs;

libavcodec/eac3dec.c:112:1: Parameter `s->dith_state.state[*]`
110. }
111. 
112. void ff_eac3_decode_transform_coeffs_aht_ch(AC3DecodeContext *s, int ch)
     ^
113. {
114.     int bin, blk, gs;

libavcodec/eac3dec.c:158:50: Call
156.             /* zero-mantissa dithering */
157.             for (blk = 0; blk < 6; blk++) {
158.                 s->pre_mantissa[ch][bin][blk] = (av_lfg_get(&s->dith_state) & 0x7FFFFF) - 0x400000;
                                                      ^
159.             }
160.         } else if (hebap < 8) {

libavutil/lfg.h:38:1: Parameter `c->state[*]`
  36.  * it may be good enough and faster for your specific use case.
  37.  */
  38. static inline unsigned int av_lfg_get(AVLFG *c){
      ^
  39.     c->state[c->index & 63] = c->state[(c->index-24) & 63] + c->state[(c->index-55) & 63];
  40.     return c->state[c->index++ & 63];

libavutil/lfg.h:40:5: Assignment
  38. static inline unsigned int av_lfg_get(AVLFG *c){
  39.     c->state[c->index & 63] = c->state[(c->index-24) & 63] + c->state[(c->index-55) & 63];
  40.     return c->state[c->index++ & 63];
          ^
  41. }
  42. 

libavcodec/eac3dec.c:158:17: Binary operation: ([0, 8388607] - 4194304):unsigned32
156.             /* zero-mantissa dithering */
157.             for (blk = 0; blk < 6; blk++) {
158.                 s->pre_mantissa[ch][bin][blk] = (av_lfg_get(&s->dith_state) & 0x7FFFFF) - 0x400000;
                     ^
159.             }
160.         } else if (hebap < 8) {

void ff_eac3_decode_transform_coeffs_aht_ch(AC3DecodeContext *s, int ch)
{
    int bin, blk, gs;
    int end_bap, gaq_mode;
    GetBitContext *gbc = &s->gbc;
    int gaq_gain[AC3_MAX_COEFS];
    gaq_mode = get_bits(gbc, 2);
    end_bap = (gaq_mode < 2) ? 12 : 17;
    gs = 0;
    if (gaq_mode == EAC3_GAQ_12 || gaq_mode == EAC3_GAQ_14) {
        for (bin = s->start_freq[ch]; bin < s->end_freq[ch]; bin++) {
            if (s->bap[ch][bin] > 7 && s->bap[ch][bin] < end_bap)
                gaq_gain[gs++] = get_bits1(gbc) << (gaq_mode-1);
        }
    } else if (gaq_mode == EAC3_GAQ_124) {
        int gc = 2;
        for (bin = s->start_freq[ch]; bin < s->end_freq[ch]; bin++) {
            if (s->bap[ch][bin] > 7 && s->bap[ch][bin] < 17) {
                if (gc++ == 2) {
                    int group_code = get_bits(gbc, 5);
                    if (group_code > 26) {
                        av_log(s->avctx, AV_LOG_WARNING, "GAQ gain group code out-of-range\n");
                        group_code = 26;
                    }
                    gaq_gain[gs++] = ff_ac3_ungroup_3_in_5_bits_tab[group_code][0];
                    gaq_gain[gs++] = ff_ac3_ungroup_3_in_5_bits_tab[group_code][1];
                    gaq_gain[gs++] = ff_ac3_ungroup_3_in_5_bits_tab[group_code][2];
                    gc = 0;
                }
            }
        }
    }
    gs=0;
    for (bin = s->start_freq[ch]; bin < s->end_freq[ch]; bin++) {
        int hebap = s->bap[ch][bin];
        int bits = ff_eac3_bits_vs_hebap[hebap];
        if (!hebap) {
            for (blk = 0; blk < 6; blk++) {
                s->pre_mantissa[ch][bin][blk] = (av_lfg_get(&s->dith_state) & 0x7FFFFF) - 0x400000;
            }
        } else if (hebap < 8) {
            int v = get_bits(gbc, bits);
            for (blk = 0; blk < 6; blk++) {
                s->pre_mantissa[ch][bin][blk] = ff_eac3_mantissa_vq[hebap][v][blk] << 8;
            }
        } else {
            int gbits, log_gain;
            if (gaq_mode != EAC3_GAQ_NO && hebap < end_bap) {
                log_gain = gaq_gain[gs++];
            } else {
                log_gain = 0;
            }
            gbits = bits - log_gain;
            for (blk = 0; blk < 6; blk++) {
                int mant = get_sbits(gbc, gbits);
                if (log_gain && mant == -(1 << (gbits-1))) {
                    int b;
                    int mbits = bits - (2 - log_gain);
                    mant = get_sbits(gbc, mbits);
                    mant <<= (23 - (mbits - 1));
                    if (mant >= 0)
                        b = 1 << (23 - log_gain);
                    else
                        b = ff_eac3_gaq_remap_2_4_b[hebap-8][log_gain-1] << 8;
                    mant += (((ff_eac3_gaq_remap_2_4_a[hebap-8][log_gain-1] << 8) * (int64_t)mant) >> 23) + b;
                } else {
                    mant <<= 24 - bits;
                    if (!log_gain) {
                        mant += ((ff_eac3_gaq_remap_1[hebap-8] << 8) * (int64_t)mant) >> 23;
                    }
                }
                s->pre_mantissa[ch][bin][blk] = mant;
            }
        }
        idct6(s->pre_mantissa[ch][bin]);
    }
}
['void ff_eac3_decode_transform_coeffs_aht_ch(AC3DecodeContext *s, int ch)\n{\n    int bin, blk, gs;\n    int end_bap, gaq_mode;\n    GetBitContext *gbc = &s->gbc;\n    int gaq_gain[AC3_MAX_COEFS];\n    gaq_mode = get_bits(gbc, 2);\n    end_bap = (gaq_mode < 2) ? 12 : 17;\n    gs = 0;\n    if (gaq_mode == EAC3_GAQ_12 || gaq_mode == EAC3_GAQ_14) {\n        for (bin = s->start_freq[ch]; bin < s->end_freq[ch]; bin++) {\n            if (s->bap[ch][bin] > 7 && s->bap[ch][bin] < end_bap)\n                gaq_gain[gs++] = get_bits1(gbc) << (gaq_mode-1);\n        }\n    } else if (gaq_mode == EAC3_GAQ_124) {\n        int gc = 2;\n        for (bin = s->start_freq[ch]; bin < s->end_freq[ch]; bin++) {\n            if (s->bap[ch][bin] > 7 && s->bap[ch][bin] < 17) {\n                if (gc++ == 2) {\n                    int group_code = get_bits(gbc, 5);\n                    if (group_code > 26) {\n                        av_log(s->avctx, AV_LOG_WARNING, "GAQ gain group code out-of-range\\n");\n                        group_code = 26;\n                    }\n                    gaq_gain[gs++] = ff_ac3_ungroup_3_in_5_bits_tab[group_code][0];\n                    gaq_gain[gs++] = ff_ac3_ungroup_3_in_5_bits_tab[group_code][1];\n                    gaq_gain[gs++] = ff_ac3_ungroup_3_in_5_bits_tab[group_code][2];\n                    gc = 0;\n                }\n            }\n        }\n    }\n    gs=0;\n    for (bin = s->start_freq[ch]; bin < s->end_freq[ch]; bin++) {\n        int hebap = s->bap[ch][bin];\n        int bits = ff_eac3_bits_vs_hebap[hebap];\n        if (!hebap) {\n            for (blk = 0; blk < 6; blk++) {\n                s->pre_mantissa[ch][bin][blk] = (av_lfg_get(&s->dith_state) & 0x7FFFFF) - 0x400000;\n            }\n        } else if (hebap < 8) {\n            int v = get_bits(gbc, bits);\n            for (blk = 0; blk < 6; blk++) {\n                s->pre_mantissa[ch][bin][blk] = ff_eac3_mantissa_vq[hebap][v][blk] << 8;\n            }\n        } else {\n            int gbits, log_gain;\n            if (gaq_mode != EAC3_GAQ_NO && hebap < end_bap) {\n                log_gain = gaq_gain[gs++];\n            } else {\n                log_gain = 0;\n            }\n            gbits = bits - log_gain;\n            for (blk = 0; blk < 6; blk++) {\n                int mant = get_sbits(gbc, gbits);\n                if (log_gain && mant == -(1 << (gbits-1))) {\n                    int b;\n                    int mbits = bits - (2 - log_gain);\n                    mant = get_sbits(gbc, mbits);\n                    mant <<= (23 - (mbits - 1));\n                    if (mant >= 0)\n                        b = 1 << (23 - log_gain);\n                    else\n                        b = ff_eac3_gaq_remap_2_4_b[hebap-8][log_gain-1] << 8;\n                    mant += (((ff_eac3_gaq_remap_2_4_a[hebap-8][log_gain-1] << 8) * (int64_t)mant) >> 23) + b;\n                } else {\n                    mant <<= 24 - bits;\n                    if (!log_gain) {\n                        mant += ((ff_eac3_gaq_remap_1[hebap-8] << 8) * (int64_t)mant) >> 23;\n                    }\n                }\n                s->pre_mantissa[ch][bin][blk] = mant;\n            }\n        }\n        idct6(s->pre_mantissa[ch][bin]);\n    }\n}', 'static inline unsigned int av_lfg_get(AVLFG *c){\n    c->state[c->index & 63] = c->state[(c->index-24) & 63] + c->state[(c->index-55) & 63];\n    return c->state[c->index++ & 63];\n}']