libavformat/matroskaenc.c:1021: error: Integer Overflow L2
  ([0, 9] - 1):unsigned64 by call to `mkv_write_seekhead`.

libavformat/matroskaenc.c:1019:15: Call
1017.         cuespos = mkv_write_cues(pb, mkv->cues, s->nb_streams);
1018. 
1019.         ret = mkv_add_seekhead_entry(mkv->main_seekhead, MATROSKA_ID_CUES    , cuespos);
                    ^
1020.         if (ret < 0) return ret;
1021.         mkv_write_seekhead(pb, mkv->main_seekhead);

libavformat/matroskaenc.c:276:1: Parameter `seekhead->entries->segmentpos`
  274. }
  275. 
  276. static int mkv_add_seekhead_entry(mkv_seekhead *seekhead, unsigned int elementid, uint64_t filepos)
       ^
  277. {
  278.     mkv_seekhead_entry *entries = seekhead->entries;

libavformat/matroskaenc.c:1021:9: Call
1019.         ret = mkv_add_seekhead_entry(mkv->main_seekhead, MATROSKA_ID_CUES    , cuespos);
1020.         if (ret < 0) return ret;
1021.         mkv_write_seekhead(pb, mkv->main_seekhead);
              ^
1022. 
1023.         // update the duration

libavformat/matroskaenc.c:304:1: Parameter `seekhead->filepos`
  302.  * -1 if an error occurred.
  303.  */
  304. static int64_t mkv_write_seekhead(ByteIOContext *pb, mkv_seekhead *seekhead)
       ^
  305. {
  306.     ebml_master metaseek, seekentry;

libavformat/matroskaenc.c:332:9: Assignment
  330. 
  331.     if (seekhead->reserved_size > 0) {
  332.         uint64_t remaining = seekhead->filepos + seekhead->reserved_size - url_ftell(pb);
               ^
  333.         put_ebml_void(pb, remaining);
  334.         url_fseek(pb, currentpos, SEEK_SET);

libavformat/matroskaenc.c:333:9: Call
  331.     if (seekhead->reserved_size > 0) {
  332.         uint64_t remaining = seekhead->filepos + seekhead->reserved_size - url_ftell(pb);
  333.         put_ebml_void(pb, remaining);
               ^
  334.         url_fseek(pb, currentpos, SEEK_SET);
  335. 

libavformat/matroskaenc.c:201:1: <LHS trace>
199.  * @param size The number of bytes to reserve, which must be at least 2.
200.  */
201. static void put_ebml_void(ByteIOContext *pb, uint64_t size)
     ^
202. {
203.     int64_t currentpos = url_ftell(pb);

libavformat/matroskaenc.c:201:1: Parameter `size`
    199.  * @param size The number of bytes to reserve, which must be at least 2.
    200.  */
    201. static void put_ebml_void(ByteIOContext *pb, uint64_t size)
         ^
    202. {
    203.     int64_t currentpos = url_ftell(pb);

libavformat/matroskaenc.c:212:9: Binary operation: ([0, 9] - 1):unsigned64 by call to `mkv_write_seekhead` 
    210.     // size if possible, 1 byte otherwise
    211.     if (size < 10)
    212.         put_ebml_num(pb, size-1, 0);
                 ^
    213.     else
    214.         put_ebml_num(pb, size-9, 8);
