libavcodec/mpegvideo_parser.c:43: error: Integer Overflow L1
  ([1099511627520, +oo] + [0, +oo]):unsigned32 by call to `ff_find_start_code`.

libavcodec/mpegvideo_parser.c:26:1: Parameter `*buf`
24. #include "mpegvideo.h"
25. 
26. static void mpegvideo_extract_headers(AVCodecParserContext *s,
    ^
27.                                       AVCodecContext *avctx,
28.                                       const uint8_t *buf, int buf_size)

libavcodec/mpegvideo_parser.c:43:14: Call
41.     while (buf < buf_end) {
42.         start_code= -1;
43.         buf= ff_find_start_code(buf, buf_end, &start_code);
                 ^
44.         bytes_left = buf_end - buf;
45.         switch(start_code) {

libavcodec/mpegvideo.c:88:1: <LHS trace>
86. };
87. 
88. const uint8_t *ff_find_start_code(const uint8_t * restrict p, const uint8_t *end, uint32_t * restrict state){
    ^
89.     int i;
90. 

libavcodec/mpegvideo.c:88:1: Parameter `*state`
  86. };
  87. 
  88. const uint8_t *ff_find_start_code(const uint8_t * restrict p, const uint8_t *end, uint32_t * restrict state){
      ^
  89.     int i;
  90. 

libavcodec/mpegvideo.c:96:9: Assignment
  94. 
  95.     for(i=0; i<3; i++){
  96.         uint32_t tmp= *state << 8;
              ^
  97.         *state= tmp + *(p++);
  98.         if(tmp == 0x100 || p==end)

libavcodec/mpegvideo.c:88:1: <RHS trace>
86. };
87. 
88. const uint8_t *ff_find_start_code(const uint8_t * restrict p, const uint8_t *end, uint32_t * restrict state){
    ^
89.     int i;
90. 

libavcodec/mpegvideo.c:88:1: Parameter `*p`
  86. };
  87. 
  88. const uint8_t *ff_find_start_code(const uint8_t * restrict p, const uint8_t *end, uint32_t * restrict state){
      ^
  89.     int i;
  90. 

libavcodec/mpegvideo.c:97:9: Binary operation: ([1099511627520, +oo] + [0, +oo]):unsigned32 by call to `ff_find_start_code` 
  95.     for(i=0; i<3; i++){
  96.         uint32_t tmp= *state << 8;
  97.         *state= tmp + *(p++);
              ^
  98.         if(tmp == 0x100 || p==end)
  99.             return p;

const uint8_t *ff_find_start_code(const uint8_t * restrict p, const uint8_t *end, uint32_t * restrict state){
    int i;
    assert(p<=end);
    if(p>=end)
        return end;
    for(i=0; i<3; i++){
        uint32_t tmp= *state << 8;
        *state= tmp + *(p++);
        if(tmp == 0x100 || p==end)
            return p;
    }
    while(p<end){
        if     (p[-1] > 1      ) p+= 3;
        else if(p[-2]          ) p+= 2;
        else if(p[-3]|(p[-1]-1)) p++;
        else{
            p++;
            break;
        }
    }
    p= FFMIN(p, end)-4;
    *state= AV_RB32(p);
    return p+4;
}
['static void mpegvideo_extract_headers(AVCodecParserContext *s,\n                                      AVCodecContext *avctx,\n                                      const uint8_t *buf, int buf_size)\n{\n    ParseContext1 *pc = s->priv_data;\n    const uint8_t *buf_end;\n    const uint8_t *buf_start= buf;\n    uint32_t start_code;\n    int frame_rate_index, ext_type, bytes_left;\n    int frame_rate_ext_n, frame_rate_ext_d;\n    int picture_structure, top_field_first, repeat_first_field, progressive_frame;\n    int horiz_size_ext, vert_size_ext, bit_rate_ext;\n    s->repeat_pict = 0;\n    buf_end = buf + buf_size;\n    while (buf < buf_end) {\n        start_code= -1;\n        buf= ff_find_start_code(buf, buf_end, &start_code);\n        bytes_left = buf_end - buf;\n        switch(start_code) {\n        case PICTURE_START_CODE:\n            ff_fetch_timestamp(s, buf-buf_start-4, 1);\n            if (bytes_left >= 2) {\n                s->pict_type = (buf[1] >> 3) & 7;\n            }\n            break;\n        case SEQ_START_CODE:\n            if (bytes_left >= 7) {\n                pc->width  = (buf[0] << 4) | (buf[1] >> 4);\n                pc->height = ((buf[1] & 0x0f) << 8) | buf[2];\n                avcodec_set_dimensions(avctx, pc->width, pc->height);\n                frame_rate_index = buf[3] & 0xf;\n                pc->frame_rate.den = avctx->time_base.den = ff_frame_rate_tab[frame_rate_index].num;\n                pc->frame_rate.num = avctx->time_base.num = ff_frame_rate_tab[frame_rate_index].den;\n                avctx->bit_rate = ((buf[4]<<10) | (buf[5]<<2) | (buf[6]>>6))*400;\n                avctx->codec_id = CODEC_ID_MPEG1VIDEO;\n                avctx->sub_id = 1;\n            }\n            break;\n        case EXT_START_CODE:\n            if (bytes_left >= 1) {\n                ext_type = (buf[0] >> 4);\n                switch(ext_type) {\n                case 0x1:\n                    if (bytes_left >= 6) {\n                        horiz_size_ext = ((buf[1] & 1) << 1) | (buf[2] >> 7);\n                        vert_size_ext = (buf[2] >> 5) & 3;\n                        bit_rate_ext = ((buf[2] & 0x1F)<<7) | (buf[3]>>1);\n                        frame_rate_ext_n = (buf[5] >> 5) & 3;\n                        frame_rate_ext_d = (buf[5] & 0x1f);\n                        pc->progressive_sequence = buf[1] & (1 << 3);\n                        avctx->has_b_frames= !(buf[5] >> 7);\n                        pc->width  |=(horiz_size_ext << 12);\n                        pc->height |=( vert_size_ext << 12);\n                        avctx->bit_rate += (bit_rate_ext << 18) * 400;\n                        avcodec_set_dimensions(avctx, pc->width, pc->height);\n                        avctx->time_base.den = pc->frame_rate.den * (frame_rate_ext_n + 1) * 2;\n                        avctx->time_base.num = pc->frame_rate.num * (frame_rate_ext_d + 1);\n                        avctx->codec_id = CODEC_ID_MPEG2VIDEO;\n                        avctx->sub_id = 2;\n                    }\n                    break;\n                case 0x8:\n                    if (bytes_left >= 5) {\n                        picture_structure = buf[2]&3;\n                        top_field_first = buf[3] & (1 << 7);\n                        repeat_first_field = buf[3] & (1 << 1);\n                        progressive_frame = buf[4] & (1 << 7);\n                        s->repeat_pict = 1;\n                        if (repeat_first_field) {\n                            if (pc->progressive_sequence) {\n                                if (top_field_first)\n                                    s->repeat_pict = 5;\n                                else\n                                    s->repeat_pict = 3;\n                            } else if (progressive_frame) {\n                                s->repeat_pict = 2;\n                            }\n                        }\n                    }\n                    break;\n                }\n            }\n            break;\n        case -1:\n            goto the_end;\n        default:\n            if (start_code >= SLICE_MIN_START_CODE &&\n                start_code <= SLICE_MAX_START_CODE)\n                goto the_end;\n            break;\n        }\n    }\n the_end: ;\n}', 'const uint8_t *ff_find_start_code(const uint8_t * restrict p, const uint8_t *end, uint32_t * restrict state){\n    int i;\n    assert(p<=end);\n    if(p>=end)\n        return end;\n    for(i=0; i<3; i++){\n        uint32_t tmp= *state << 8;\n        *state= tmp + *(p++);\n        if(tmp == 0x100 || p==end)\n            return p;\n    }\n    while(p<end){\n        if     (p[-1] > 1      ) p+= 3;\n        else if(p[-2]          ) p+= 2;\n        else if(p[-3]|(p[-1]-1)) p++;\n        else{\n            p++;\n            break;\n        }\n    }\n    p= FFMIN(p, end)-4;\n    *state= AV_RB32(p);\n    return p+4;\n}']