libavformat/utils.c:1142: error: Integer Overflow L2
  ([0, +oo] - 1):unsigned64 by call to `av_compare_mod`.

libavformat/utils.c:1139:17: Assignment
1137. 
1138.             if (next_pkt->dts != AV_NOPTS_VALUE) {
1139.                 int wrap_bits = s->streams[next_pkt->stream_index]->pts_wrap_bits;
                      ^
1140.                 while (pktl && next_pkt->pts == AV_NOPTS_VALUE) {
1141.                     if (pktl->pkt.stream_index == next_pkt->stream_index &&

libavformat/utils.c:1142:26: Call
1140.                 while (pktl && next_pkt->pts == AV_NOPTS_VALUE) {
1141.                     if (pktl->pkt.stream_index == next_pkt->stream_index &&
1142.                         (av_compare_mod(next_pkt->dts, pktl->pkt.dts, 2LL << (wrap_bits - 1)) < 0) &&
                               ^
1143.                          av_compare_mod(pktl->pkt.pts, pktl->pkt.dts, 2LL << (wrap_bits - 1))) {
1144.                         // not B-frame

libavutil/mathematics.c:135:1: <LHS trace>
133. }
134. 
135. int64_t av_compare_mod(uint64_t a, uint64_t b, uint64_t mod){
     ^
136.     int64_t c= (a-b) & (mod-1);
137.     if(c > (mod>>1))

libavutil/mathematics.c:135:1: Parameter `mod`
  133. }
  134. 
  135. int64_t av_compare_mod(uint64_t a, uint64_t b, uint64_t mod){
       ^
  136.     int64_t c= (a-b) & (mod-1);
  137.     if(c > (mod>>1))

libavutil/mathematics.c:136:5: Binary operation: ([0, +oo] - 1):unsigned64 by call to `av_compare_mod` 
  134. 
  135. int64_t av_compare_mod(uint64_t a, uint64_t b, uint64_t mod){
  136.     int64_t c= (a-b) & (mod-1);
           ^
  137.     if(c > (mod>>1))
  138.         c-= mod;

int64_t av_compare_mod(uint64_t a, uint64_t b, uint64_t mod){
    int64_t c= (a-b) & (mod-1);
    if(c > (mod>>1))
        c-= mod;
    return c;
}
['int av_read_frame(AVFormatContext *s, AVPacket *pkt)\n{\n    const int genpts = s->flags & AVFMT_FLAG_GENPTS;\n    int eof = 0;\n    if (!genpts)\n        return s->packet_buffer\n               ? read_from_packet_buffer(&s->packet_buffer,\n                                         &s->packet_buffer_end, pkt)\n               : read_frame_internal(s, pkt);\n    for (;;) {\n        int ret;\n        AVPacketList *pktl = s->packet_buffer;\n        if (pktl) {\n            AVPacket *next_pkt = &pktl->pkt;\n            if (next_pkt->dts != AV_NOPTS_VALUE) {\n                int wrap_bits = s->streams[next_pkt->stream_index]->pts_wrap_bits;\n                while (pktl && next_pkt->pts == AV_NOPTS_VALUE) {\n                    if (pktl->pkt.stream_index == next_pkt->stream_index &&\n                        (av_compare_mod(next_pkt->dts, pktl->pkt.dts, 2LL << (wrap_bits - 1)) < 0) &&\n                         av_compare_mod(pktl->pkt.pts, pktl->pkt.dts, 2LL << (wrap_bits - 1))) {\n                        next_pkt->pts = pktl->pkt.dts;\n                    }\n                    pktl = pktl->next;\n                }\n                pktl = s->packet_buffer;\n            }\n            if (!(next_pkt->pts == AV_NOPTS_VALUE &&\n                  next_pkt->dts != AV_NOPTS_VALUE && !eof))\n                return read_from_packet_buffer(&s->packet_buffer,\n                                               &s->packet_buffer_end, pkt);\n        }\n        ret = read_frame_internal(s, pkt);\n        if (ret < 0) {\n            if (pktl && ret != AVERROR(EAGAIN)) {\n                eof = 1;\n                continue;\n            } else\n                return ret;\n        }\n        if (av_dup_packet(add_to_pktbuf(&s->packet_buffer, pkt,\n                                        &s->packet_buffer_end)) < 0)\n            return AVERROR(ENOMEM);\n    }\n}', 'int64_t av_compare_mod(uint64_t a, uint64_t b, uint64_t mod){\n    int64_t c= (a-b) & (mod-1);\n    if(c > (mod>>1))\n        c-= mod;\n    return c;\n}']