libavformat/rmdec.c:516: error: Integer Overflow L1
  ([1099511627520, +oo] + [0, +oo]):unsigned32.

libavformat/rmdec.c:505:5: <LHS trace>
503.     ByteIOContext *pb = s->pb;
504.     AVStream *st;
505.     uint32_t state=0xFFFFFFFF;
         ^
506. 
507.     while(!url_feof(pb)){

libavformat/rmdec.c:505:5: Assignment
503.     ByteIOContext *pb = s->pb;
504.     AVStream *st;
505.     uint32_t state=0xFFFFFFFF;
         ^
506. 
507.     while(!url_feof(pb)){

libavformat/rmdec.c:516:33: <RHS trace>
514.             *flags= 0;
515.         }else{
516.             state= (state<<8) + get_byte(pb);
                                     ^
517. 
518.             if(state == MKBETAG('I', 'N', 'D', 'X')){

libavformat/rmdec.c:516:33: Call
514.             *flags= 0;
515.         }else{
516.             state= (state<<8) + get_byte(pb);
                                     ^
517. 
518.             if(state == MKBETAG('I', 'N', 'D', 'X')){

libavformat/aviobuf.c:361:13: Assignment
  359.             return *s->buf_ptr++;
  360.         else
  361.             return 0;
                   ^
  362.     }
  363. }

libavformat/rmdec.c:516:13: Binary operation: ([1099511627520, +oo] + [0, +oo]):unsigned32
514.             *flags= 0;
515.         }else{
516.             state= (state<<8) + get_byte(pb);
                 ^
517. 
518.             if(state == MKBETAG('I', 'N', 'D', 'X')){

static int sync(AVFormatContext *s, int64_t *timestamp, int *flags, int *stream_index, int64_t *pos){
    RMDemuxContext *rm = s->priv_data;
    ByteIOContext *pb = s->pb;
    AVStream *st;
    uint32_t state=0xFFFFFFFF;
    while(!url_feof(pb)){
        int len, num, res, i;
        *pos= url_ftell(pb) - 3;
        if(rm->remaining_len > 0){
            num= rm->current_stream;
            len= rm->remaining_len;
            *timestamp = AV_NOPTS_VALUE;
            *flags= 0;
        }else{
            state= (state<<8) + get_byte(pb);
            if(state == MKBETAG('I', 'N', 'D', 'X')){
                int n_pkts, expected_len;
                len = get_be32(pb);
                url_fskip(pb, 2);
                n_pkts = get_be32(pb);
                expected_len = 20 + n_pkts * 14;
                if (len == 20)
                    len = expected_len;
                else if (len != expected_len)
                    av_log(s, AV_LOG_WARNING,
                           "Index size %d (%d pkts) is wrong, should be %d.\n",
                           len, n_pkts, expected_len);
                len -= 14;
                if(len<0)
                    continue;
                goto skip;
            }
            if(state > (unsigned)0xFFFF || state <= 12)
                continue;
            len=state - 12;
            state= 0xFFFFFFFF;
            num = get_be16(pb);
            *timestamp = get_be32(pb);
            res= get_byte(pb);
            *flags = get_byte(pb);
        }
        for(i=0;i<s->nb_streams;i++) {
            st = s->streams[i];
            if (num == st->id)
                break;
        }
        if (i == s->nb_streams) {
skip:
            url_fskip(pb, len);
            rm->remaining_len = 0;
            continue;
        }
        *stream_index= i;
        return len;
    }
    return -1;
}
['static int sync(AVFormatContext *s, int64_t *timestamp, int *flags, int *stream_index, int64_t *pos){\n    RMDemuxContext *rm = s->priv_data;\n    ByteIOContext *pb = s->pb;\n    AVStream *st;\n    uint32_t state=0xFFFFFFFF;\n    while(!url_feof(pb)){\n        int len, num, res, i;\n        *pos= url_ftell(pb) - 3;\n        if(rm->remaining_len > 0){\n            num= rm->current_stream;\n            len= rm->remaining_len;\n            *timestamp = AV_NOPTS_VALUE;\n            *flags= 0;\n        }else{\n            state= (state<<8) + get_byte(pb);\n            if(state == MKBETAG(\'I\', \'N\', \'D\', \'X\')){\n                int n_pkts, expected_len;\n                len = get_be32(pb);\n                url_fskip(pb, 2);\n                n_pkts = get_be32(pb);\n                expected_len = 20 + n_pkts * 14;\n                if (len == 20)\n                    len = expected_len;\n                else if (len != expected_len)\n                    av_log(s, AV_LOG_WARNING,\n                           "Index size %d (%d pkts) is wrong, should be %d.\\n",\n                           len, n_pkts, expected_len);\n                len -= 14;\n                if(len<0)\n                    continue;\n                goto skip;\n            }\n            if(state > (unsigned)0xFFFF || state <= 12)\n                continue;\n            len=state - 12;\n            state= 0xFFFFFFFF;\n            num = get_be16(pb);\n            *timestamp = get_be32(pb);\n            res= get_byte(pb);\n            *flags = get_byte(pb);\n        }\n        for(i=0;i<s->nb_streams;i++) {\n            st = s->streams[i];\n            if (num == st->id)\n                break;\n        }\n        if (i == s->nb_streams) {\nskip:\n            url_fskip(pb, len);\n            rm->remaining_len = 0;\n            continue;\n        }\n        *stream_index= i;\n        return len;\n    }\n    return -1;\n}', 'int get_byte(ByteIOContext *s)\n{\n    if (s->buf_ptr < s->buf_end) {\n        return *s->buf_ptr++;\n    } else {\n        fill_buffer(s);\n        if (s->buf_ptr < s->buf_end)\n            return *s->buf_ptr++;\n        else\n            return 0;\n    }\n}']