libavcodec/dss_sp.c:413: error: Integer Overflow L2
  ([min(-114, `p->fparam.pitch_lag[*]`), 162] - 23):unsigned32.

libavcodec/dss_sp.c:303:1: <LHS trace>
301. }
302. 
303. static void dss_sp_unpack_coeffs(DssSpContext *p, const uint8_t *src)
     ^
304. {
305.     BitstreamContext bc;

libavcodec/dss_sp.c:303:1: Parameter `p->fparam.pitch_lag[*]`
301. }
302. 
303. static void dss_sp_unpack_coeffs(DssSpContext *p, const uint8_t *src)
     ^
304. {
305.     BitstreamContext bc;

libavcodec/dss_sp.c:408:5: Assignment
406.     }
407. 
408.     pitch_lag = fparam->pitch_lag[0];
         ^
409.     for (i = 1; i < SUBFRAMES; i++) {
410.         if (pitch_lag > 162) {

libavcodec/dss_sp.c:413:13: Binary operation: ([min(-114, p->fparam.pitch_lag[*]), 162] - 23):unsigned32
411.             fparam->pitch_lag[i] += 162 - 23;
412.         } else {
413.             tmp = pitch_lag - 23;
                 ^
414.             if (tmp < 36)
415.                 tmp = 36;

static void dss_sp_unpack_coeffs(DssSpContext *p, const uint8_t *src)
{
    BitstreamContext bc;
    DssSpFrame *fparam = &p->fparam;
    int i;
    int subframe_idx;
    uint32_t combined_pitch;
    uint32_t tmp;
    uint32_t pitch_lag;
    for (i = 0; i < DSS_SP_FRAME_SIZE; i += 2) {
        p->bits[i]     = src[i + 1];
        p->bits[i + 1] = src[i];
    }
    bitstream_init(&bc, p->bits, DSS_SP_FRAME_SIZE * 8);
    for (i = 0; i < 2; i++)
        fparam->filter_idx[i] = bitstream_read(&bc, 5);
    for (; i < 8; i++)
        fparam->filter_idx[i] = bitstream_read(&bc, 4);
    for (; i < 14; i++)
        fparam->filter_idx[i] = bitstream_read(&bc, 3);
    for (subframe_idx = 0; subframe_idx < 4; subframe_idx++) {
        fparam->sf_adaptive_gain[subframe_idx] = bitstream_read(&bc, 5);
        fparam->sf[subframe_idx].combined_pulse_pos = bitstream_read(&bc, 31);
        fparam->sf[subframe_idx].gain = bitstream_read(&bc, 6);
        for (i = 0; i < 7; i++)
            fparam->sf[subframe_idx].pulse_val[i] = bitstream_read(&bc, 3);
    }
    for (subframe_idx = 0; subframe_idx < 4; subframe_idx++) {
        unsigned int C72_binomials[PULSE_MAX] = {
            72, 2556, 59640, 1028790, 13991544, 156238908, 1473109704,
            3379081753
        };
        unsigned int combined_pulse_pos =
            fparam->sf[subframe_idx].combined_pulse_pos;
        int index = 6;
        if (combined_pulse_pos < C72_binomials[PULSE_MAX - 1]) {
            if (p->pulse_dec_mode) {
                int pulse, pulse_idx;
                pulse              = PULSE_MAX - 1;
                pulse_idx          = 71;
                combined_pulse_pos =
                    fparam->sf[subframe_idx].combined_pulse_pos;
                for (i = 0; i < 7; i++) {
                    for (;
                         combined_pulse_pos <
                         dss_sp_combinatorial_table[pulse][pulse_idx];
                         --pulse_idx)
                        ;
                    combined_pulse_pos -=
                        dss_sp_combinatorial_table[pulse][pulse_idx];
                    pulse--;
                    fparam->sf[subframe_idx].pulse_pos[i] = pulse_idx;
                }
            }
        } else {
            p->pulse_dec_mode = 0;
            fparam->sf[subframe_idx].pulse_pos[6] = 0;
            for (i = 71; i >= 0; i--) {
                if (C72_binomials[index] <= combined_pulse_pos) {
                    combined_pulse_pos -= C72_binomials[index];
                    fparam->sf[subframe_idx].pulse_pos[(index ^ 7) - 1] = i;
                    if (!index)
                        break;
                    --index;
                }
                --C72_binomials[0];
                if (index) {
                    int a;
                    for (a = 0; a < index; a++)
                        C72_binomials[a + 1] -= C72_binomials[a];
                }
            }
        }
    }
    combined_pitch = bitstream_read(&bc, 24);
    fparam->pitch_lag[0] = (combined_pitch % 151) + 36;
    combined_pitch /= 151;
    for (i = 1; i < SUBFRAMES; i++) {
        fparam->pitch_lag[i] = combined_pitch % 48;
        combined_pitch      /= 48;
    }
    pitch_lag = fparam->pitch_lag[0];
    for (i = 1; i < SUBFRAMES; i++) {
        if (pitch_lag > 162) {
            fparam->pitch_lag[i] += 162 - 23;
        } else {
            tmp = pitch_lag - 23;
            if (tmp < 36)
                tmp = 36;
            fparam->pitch_lag[i] += tmp;
        }
        pitch_lag = fparam->pitch_lag[i];
    }
}
['static void dss_sp_unpack_coeffs(DssSpContext *p, const uint8_t *src)\n{\n    BitstreamContext bc;\n    DssSpFrame *fparam = &p->fparam;\n    int i;\n    int subframe_idx;\n    uint32_t combined_pitch;\n    uint32_t tmp;\n    uint32_t pitch_lag;\n    for (i = 0; i < DSS_SP_FRAME_SIZE; i += 2) {\n        p->bits[i]     = src[i + 1];\n        p->bits[i + 1] = src[i];\n    }\n    bitstream_init(&bc, p->bits, DSS_SP_FRAME_SIZE * 8);\n    for (i = 0; i < 2; i++)\n        fparam->filter_idx[i] = bitstream_read(&bc, 5);\n    for (; i < 8; i++)\n        fparam->filter_idx[i] = bitstream_read(&bc, 4);\n    for (; i < 14; i++)\n        fparam->filter_idx[i] = bitstream_read(&bc, 3);\n    for (subframe_idx = 0; subframe_idx < 4; subframe_idx++) {\n        fparam->sf_adaptive_gain[subframe_idx] = bitstream_read(&bc, 5);\n        fparam->sf[subframe_idx].combined_pulse_pos = bitstream_read(&bc, 31);\n        fparam->sf[subframe_idx].gain = bitstream_read(&bc, 6);\n        for (i = 0; i < 7; i++)\n            fparam->sf[subframe_idx].pulse_val[i] = bitstream_read(&bc, 3);\n    }\n    for (subframe_idx = 0; subframe_idx < 4; subframe_idx++) {\n        unsigned int C72_binomials[PULSE_MAX] = {\n            72, 2556, 59640, 1028790, 13991544, 156238908, 1473109704,\n            3379081753\n        };\n        unsigned int combined_pulse_pos =\n            fparam->sf[subframe_idx].combined_pulse_pos;\n        int index = 6;\n        if (combined_pulse_pos < C72_binomials[PULSE_MAX - 1]) {\n            if (p->pulse_dec_mode) {\n                int pulse, pulse_idx;\n                pulse              = PULSE_MAX - 1;\n                pulse_idx          = 71;\n                combined_pulse_pos =\n                    fparam->sf[subframe_idx].combined_pulse_pos;\n                for (i = 0; i < 7; i++) {\n                    for (;\n                         combined_pulse_pos <\n                         dss_sp_combinatorial_table[pulse][pulse_idx];\n                         --pulse_idx)\n                        ;\n                    combined_pulse_pos -=\n                        dss_sp_combinatorial_table[pulse][pulse_idx];\n                    pulse--;\n                    fparam->sf[subframe_idx].pulse_pos[i] = pulse_idx;\n                }\n            }\n        } else {\n            p->pulse_dec_mode = 0;\n            fparam->sf[subframe_idx].pulse_pos[6] = 0;\n            for (i = 71; i >= 0; i--) {\n                if (C72_binomials[index] <= combined_pulse_pos) {\n                    combined_pulse_pos -= C72_binomials[index];\n                    fparam->sf[subframe_idx].pulse_pos[(index ^ 7) - 1] = i;\n                    if (!index)\n                        break;\n                    --index;\n                }\n                --C72_binomials[0];\n                if (index) {\n                    int a;\n                    for (a = 0; a < index; a++)\n                        C72_binomials[a + 1] -= C72_binomials[a];\n                }\n            }\n        }\n    }\n    combined_pitch = bitstream_read(&bc, 24);\n    fparam->pitch_lag[0] = (combined_pitch % 151) + 36;\n    combined_pitch /= 151;\n    for (i = 1; i < SUBFRAMES; i++) {\n        fparam->pitch_lag[i] = combined_pitch % 48;\n        combined_pitch      /= 48;\n    }\n    pitch_lag = fparam->pitch_lag[0];\n    for (i = 1; i < SUBFRAMES; i++) {\n        if (pitch_lag > 162) {\n            fparam->pitch_lag[i] += 162 - 23;\n        } else {\n            tmp = pitch_lag - 23;\n            if (tmp < 36)\n                tmp = 36;\n            fparam->pitch_lag[i] += tmp;\n        }\n        pitch_lag = fparam->pitch_lag[i];\n    }\n}']