libavcodec/h264_parser.c:97: error: Integer Overflow L2
  ([0, `buf_size`] - [0, 5]):unsigned32.

libavcodec/h264_parser.c:36:1: <LHS trace>
34. 
35. 
36. static int h264_find_frame_end(H264Context *h, const uint8_t *buf, int buf_size)
    ^
37. {
38.     int i;

libavcodec/h264_parser.c:36:1: Parameter `buf_size`
34. 
35. 
36. static int h264_find_frame_end(H264Context *h, const uint8_t *buf, int buf_size)
    ^
37. {
38.     int i;

libavcodec/h264_parser.c:44:9: <RHS trace>
42.     state= pc->state;
43.     if(state>13)
44.         state= 7;
            ^
45. 
46.     for(i=0; i<buf_size; i++){

libavcodec/h264_parser.c:44:9: Assignment
42.     state= pc->state;
43.     if(state>13)
44.         state= 7;
            ^
45. 
46.     for(i=0; i<buf_size; i++){

libavcodec/h264_parser.c:97:5: Binary operation: ([0, buf_size] - [0, 5]):unsigned32
95.     pc->state=7;
96.     pc->frame_start_found= 0;
97.     return i-(state&5);
        ^
98. }
99. 

static int h264_find_frame_end(H264Context *h, const uint8_t *buf, int buf_size)
{
    int i;
    uint32_t state;
    ParseContext *pc = &h->parse_context;
    state= pc->state;
    if(state>13)
        state= 7;
    for(i=0; i<buf_size; i++){
        if(state==7){
#if HAVE_FAST_UNALIGNED
#    if HAVE_FAST_64BIT
            while(i<buf_size && !((~*(const uint64_t*)(buf+i) & (*(const uint64_t*)(buf+i) - 0x0101010101010101ULL)) & 0x8080808080808080ULL))
                i+=8;
#    else
            while(i<buf_size && !((~*(const uint32_t*)(buf+i) & (*(const uint32_t*)(buf+i) - 0x01010101U)) & 0x80808080U))
                i+=4;
#    endif
#endif
            for(; i<buf_size; i++){
                if(!buf[i]){
                    state=2;
                    break;
                }
            }
        }else if(state<=2){
            if(buf[i]==1)   state^= 5;
            else if(buf[i]) state = 7;
            else            state>>=1;
        }else if(state<=5){
            int v= buf[i] & 0x1F;
            if(v==6 || v==7 || v==8 || v==9){
                if(pc->frame_start_found){
                    i++;
                    goto found;
                }
            }else if(v==1 || v==2 || v==5){
                if(pc->frame_start_found){
                    state+=8;
                    continue;
                }else
                    pc->frame_start_found = 1;
            }
            state= 7;
        }else{
            if(buf[i] & 0x80)
                goto found;
            state= 7;
        }
    }
    pc->state= state;
    return END_NOT_FOUND;
found:
    pc->state=7;
    pc->frame_start_found= 0;
    return i-(state&5);
}
['static int h264_find_frame_end(H264Context *h, const uint8_t *buf, int buf_size)\n{\n    int i;\n    uint32_t state;\n    ParseContext *pc = &h->parse_context;\n    state= pc->state;\n    if(state>13)\n        state= 7;\n    for(i=0; i<buf_size; i++){\n        if(state==7){\n#if HAVE_FAST_UNALIGNED\n#    if HAVE_FAST_64BIT\n            while(i<buf_size && !((~*(const uint64_t*)(buf+i) & (*(const uint64_t*)(buf+i) - 0x0101010101010101ULL)) & 0x8080808080808080ULL))\n                i+=8;\n#    else\n            while(i<buf_size && !((~*(const uint32_t*)(buf+i) & (*(const uint32_t*)(buf+i) - 0x01010101U)) & 0x80808080U))\n                i+=4;\n#    endif\n#endif\n            for(; i<buf_size; i++){\n                if(!buf[i]){\n                    state=2;\n                    break;\n                }\n            }\n        }else if(state<=2){\n            if(buf[i]==1)   state^= 5;\n            else if(buf[i]) state = 7;\n            else            state>>=1;\n        }else if(state<=5){\n            int v= buf[i] & 0x1F;\n            if(v==6 || v==7 || v==8 || v==9){\n                if(pc->frame_start_found){\n                    i++;\n                    goto found;\n                }\n            }else if(v==1 || v==2 || v==5){\n                if(pc->frame_start_found){\n                    state+=8;\n                    continue;\n                }else\n                    pc->frame_start_found = 1;\n            }\n            state= 7;\n        }else{\n            if(buf[i] & 0x80)\n                goto found;\n            state= 7;\n        }\n    }\n    pc->state= state;\n    return END_NOT_FOUND;\nfound:\n    pc->state=7;\n    pc->frame_start_found= 0;\n    return i-(state&5);\n}']