libavformat/mxfenc.c:1316: error: Integer Overflow L1
  ([1099511627520, +oo] + `*pkt->data`):unsigned32.

libavformat/mxfenc.c:1312:5: <LHS trace>
1310.     MXFStreamContext *sc = st->priv_data;
1311.     MXFContext *mxf = s->priv_data;
1312.     uint32_t c = -1;
          ^
1313.     int i;
1314. 

libavformat/mxfenc.c:1312:5: Assignment
1310.     MXFStreamContext *sc = st->priv_data;
1311.     MXFContext *mxf = s->priv_data;
1312.     uint32_t c = -1;
          ^
1313.     int i;
1314. 

libavformat/mxfenc.c:1307:1: <RHS trace>
1305. }
1306. 
1307. static int mxf_parse_mpeg2_frame(AVFormatContext *s, AVStream *st,
      ^
1308.                                  AVPacket *pkt, MXFIndexEntry *e)
1309. {

libavformat/mxfenc.c:1307:1: Parameter `*pkt->data`
1305. }
1306. 
1307. static int mxf_parse_mpeg2_frame(AVFormatContext *s, AVStream *st,
      ^
1308.                                  AVPacket *pkt, MXFIndexEntry *e)
1309. {

libavformat/mxfenc.c:1316:9: Binary operation: ([1099511627520, +oo] + *pkt->data):unsigned32
1314. 
1315.     for(i = 0; i < pkt->size - 4; i++) {
1316.         c = (c<<8) + pkt->data[i];
              ^
1317.         if (c == 0x1b5) {
1318.             if ((pkt->data[i+1] & 0xf0) == 0x10) { // seq ext

static int mxf_parse_mpeg2_frame(AVFormatContext *s, AVStream *st,
                                 AVPacket *pkt, MXFIndexEntry *e)
{
    MXFStreamContext *sc = st->priv_data;
    MXFContext *mxf = s->priv_data;
    uint32_t c = -1;
    int i;
    for(i = 0; i < pkt->size - 4; i++) {
        c = (c<<8) + pkt->data[i];
        if (c == 0x1b5) {
            if ((pkt->data[i+1] & 0xf0) == 0x10) {
                st->codec->profile = pkt->data[i+1] & 0x07;
                st->codec->level   = pkt->data[i+2] >> 4;
            } else if (i + 5 < pkt->size && (pkt->data[i+1] & 0xf0) == 0x80) {
                sc->interlaced = !(pkt->data[i+5] & 0x80);
                break;
            }
        } else if (c == 0x1b8) {
            if (pkt->data[i+4]>>6 & 0x01) {
                sc->closed_gop = 1;
                if (e->flags & 0x40)
                    e->flags |= 0x80;
            }
            if (!mxf->header_written) {
                unsigned hours   =  (pkt->data[i+1]>>2) & 0x1f;
                unsigned minutes = ((pkt->data[i+1] & 0x03) << 4) | (pkt->data[i+2]>>4);
                unsigned seconds = ((pkt->data[i+2] & 0x07) << 3) | (pkt->data[i+3]>>5);
                unsigned frames  = ((pkt->data[i+3] & 0x1f) << 1) | (pkt->data[i+4]>>7);
                mxf->timecode_drop_frame = !!(pkt->data[i+1] & 0x80);
                mxf->timecode_start = (hours*3600 + minutes*60 + seconds) *
                    mxf->timecode_base + frames;
                if (mxf->timecode_drop_frame) {
                    unsigned tminutes = 60 * hours + minutes;
                    mxf->timecode_start -= 2 * (tminutes - tminutes / 10);
                }
                av_log(s, AV_LOG_DEBUG, "frame %d %d:%d:%d%c%d\n", mxf->timecode_start,
                       hours, minutes, seconds, mxf->timecode_drop_frame ? ';':':', frames);
            }
        } else if (c == 0x1b3) {
            e->flags |= 0x40;
            switch ((pkt->data[i+4]>>4) & 0xf) {
            case 2:  sc->aspect_ratio = (AVRational){  4,  3}; break;
            case 3:  sc->aspect_ratio = (AVRational){ 16,  9}; break;
            case 4:  sc->aspect_ratio = (AVRational){221,100}; break;
            default:
                av_reduce(&sc->aspect_ratio.num, &sc->aspect_ratio.den,
                          st->codec->width, st->codec->height, 1024*1024);
            }
        } else if (c == 0x100) {
            int pict_type = (pkt->data[i+2]>>3) & 0x07;
            e->temporal_ref = (pkt->data[i+1]<<2) | (pkt->data[i+2]>>6);
            if (pict_type == 2) {
                e->flags |= 0x22;
                sc->closed_gop = 0;
            } else if (pict_type == 3) {
                if (sc->closed_gop)
                    e->flags |= 0x13;
                else
                    e->flags |= 0x33;
                sc->temporal_reordering = -1;
            } else if (!pict_type) {
                av_log(s, AV_LOG_ERROR, "error parsing mpeg2 frame\n");
                return 0;
            }
        }
    }
    if (s->oformat != &mxf_d10_muxer)
        sc->codec_ul = mxf_get_mpeg2_codec_ul(st->codec);
    return !!sc->codec_ul;
}
['static int mxf_parse_mpeg2_frame(AVFormatContext *s, AVStream *st,\n                                 AVPacket *pkt, MXFIndexEntry *e)\n{\n    MXFStreamContext *sc = st->priv_data;\n    MXFContext *mxf = s->priv_data;\n    uint32_t c = -1;\n    int i;\n    for(i = 0; i < pkt->size - 4; i++) {\n        c = (c<<8) + pkt->data[i];\n        if (c == 0x1b5) {\n            if ((pkt->data[i+1] & 0xf0) == 0x10) {\n                st->codec->profile = pkt->data[i+1] & 0x07;\n                st->codec->level   = pkt->data[i+2] >> 4;\n            } else if (i + 5 < pkt->size && (pkt->data[i+1] & 0xf0) == 0x80) {\n                sc->interlaced = !(pkt->data[i+5] & 0x80);\n                break;\n            }\n        } else if (c == 0x1b8) {\n            if (pkt->data[i+4]>>6 & 0x01) {\n                sc->closed_gop = 1;\n                if (e->flags & 0x40)\n                    e->flags |= 0x80;\n            }\n            if (!mxf->header_written) {\n                unsigned hours   =  (pkt->data[i+1]>>2) & 0x1f;\n                unsigned minutes = ((pkt->data[i+1] & 0x03) << 4) | (pkt->data[i+2]>>4);\n                unsigned seconds = ((pkt->data[i+2] & 0x07) << 3) | (pkt->data[i+3]>>5);\n                unsigned frames  = ((pkt->data[i+3] & 0x1f) << 1) | (pkt->data[i+4]>>7);\n                mxf->timecode_drop_frame = !!(pkt->data[i+1] & 0x80);\n                mxf->timecode_start = (hours*3600 + minutes*60 + seconds) *\n                    mxf->timecode_base + frames;\n                if (mxf->timecode_drop_frame) {\n                    unsigned tminutes = 60 * hours + minutes;\n                    mxf->timecode_start -= 2 * (tminutes - tminutes / 10);\n                }\n                av_log(s, AV_LOG_DEBUG, "frame %d %d:%d:%d%c%d\\n", mxf->timecode_start,\n                       hours, minutes, seconds, mxf->timecode_drop_frame ? \';\':\':\', frames);\n            }\n        } else if (c == 0x1b3) {\n            e->flags |= 0x40;\n            switch ((pkt->data[i+4]>>4) & 0xf) {\n            case 2:  sc->aspect_ratio = (AVRational){  4,  3}; break;\n            case 3:  sc->aspect_ratio = (AVRational){ 16,  9}; break;\n            case 4:  sc->aspect_ratio = (AVRational){221,100}; break;\n            default:\n                av_reduce(&sc->aspect_ratio.num, &sc->aspect_ratio.den,\n                          st->codec->width, st->codec->height, 1024*1024);\n            }\n        } else if (c == 0x100) {\n            int pict_type = (pkt->data[i+2]>>3) & 0x07;\n            e->temporal_ref = (pkt->data[i+1]<<2) | (pkt->data[i+2]>>6);\n            if (pict_type == 2) {\n                e->flags |= 0x22;\n                sc->closed_gop = 0;\n            } else if (pict_type == 3) {\n                if (sc->closed_gop)\n                    e->flags |= 0x13;\n                else\n                    e->flags |= 0x33;\n                sc->temporal_reordering = -1;\n            } else if (!pict_type) {\n                av_log(s, AV_LOG_ERROR, "error parsing mpeg2 frame\\n");\n                return 0;\n            }\n        }\n    }\n    if (s->oformat != &mxf_d10_muxer)\n        sc->codec_ul = mxf_get_mpeg2_codec_ul(st->codec);\n    return !!sc->codec_ul;\n}']