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

libavformat/matroskaenc.c:1535:9: Call
1533. 
1534.     if (mkv->dyn_bc) {
1535.         end_ebml_master(mkv->dyn_bc, mkv->cluster);
              ^
1536.         mkv_flush_dynbuf(s);
1537.     } else if (mkv->cluster_pos) {

libavformat/matroskaenc.c:255:1: Parameter `pb->buffer->strlen`
  253. }
  254. 
  255. static void end_ebml_master(AVIOContext *pb, ebml_master master)
       ^
  256. {
  257.     int64_t pos = avio_tell(pb);

libavformat/matroskaenc.c:1580:9: Call
1578.         }
1579. 
1580.         mkv_write_seekhead(pb, mkv->main_seekhead);
              ^
1581. 
1582.         // update the duration

libavformat/matroskaenc.c:334:1: Parameter `seekhead->filepos`
  332.  * -1 if an error occurred.
  333.  */
  334. static int64_t mkv_write_seekhead(AVIOContext *pb, mkv_seekhead *seekhead)
       ^
  335. {
  336.     ebml_master metaseek, seekentry;

libavformat/matroskaenc.c:365:9: Assignment
  363. 
  364.     if (seekhead->reserved_size > 0) {
  365.         uint64_t remaining = seekhead->filepos + seekhead->reserved_size - avio_tell(pb);
               ^
  366.         put_ebml_void(pb, remaining);
  367.         avio_seek(pb, currentpos, SEEK_SET);

libavformat/matroskaenc.c:366:9: Call
  364.     if (seekhead->reserved_size > 0) {
  365.         uint64_t remaining = seekhead->filepos + seekhead->reserved_size - avio_tell(pb);
  366.         put_ebml_void(pb, remaining);
               ^
  367.         avio_seek(pb, currentpos, SEEK_SET);
  368. 

libavformat/matroskaenc.c:228:1: <LHS trace>
226.  * @param size The number of bytes to reserve, which must be at least 2.
227.  */
228. static void put_ebml_void(AVIOContext *pb, uint64_t size)
     ^
229. {
230.     int64_t currentpos = avio_tell(pb);

libavformat/matroskaenc.c:228:1: Parameter `size`
    226.  * @param size The number of bytes to reserve, which must be at least 2.
    227.  */
    228. static void put_ebml_void(AVIOContext *pb, uint64_t size)
         ^
    229. {
    230.     int64_t currentpos = avio_tell(pb);

libavformat/matroskaenc.c:239:9: Binary operation: ([0, 9] - 1):unsigned64 by call to `mkv_write_seekhead` 
    237.     // size if possible, 1 byte otherwise
    238.     if (size < 10)
    239.         put_ebml_num(pb, size - 1, 0);
                 ^
    240.     else
    241.         put_ebml_num(pb, size - 9, 8);
