Revision 7bbc686f libavcodec/vc1_parser.c

View differences:

libavcodec/vc1_parser.c
99 99
{
100 100
    int i;
101 101
    uint32_t state= -1;
102
    int charged=0;
102 103

  
103 104
    for(i=0; i<buf_size; i++){
104 105
        state= (state<<8) | buf[i];
105
        if(IS_MARKER(state) && state != VC1_CODE_SEQHDR && state != VC1_CODE_ENTRYPOINT)
106
            return i-3;
106
        if(IS_MARKER(state)){
107
            if(state == VC1_CODE_SEQHDR || state == VC1_CODE_ENTRYPOINT){
108
                charged=1;
109
            }else if(charged){
110
                return i-3;
111
            }
112
        }
107 113
    }
108 114
    return 0;
109 115
}

Also available in: Unified diff