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

libavformat/matroskaenc.c:1136:9: Call
1134. 
1135.     if (mkv->dyn_bc) {
1136.         end_ebml_master(mkv->dyn_bc, mkv->cluster);
              ^
1137.         mkv_flush_dynbuf(s);
1138.     } else if (mkv->cluster_pos) {

libavformat/matroskaenc.c:230:1: Parameter `pb->buffer->strlen`
  228. }
  229. 
  230. static void end_ebml_master(AVIOContext *pb, ebml_master master)
       ^
  231. {
  232.     int64_t pos = avio_tell(pb);

libavformat/matroskaenc.c:1150:9: Call
1148.         }
1149. 
1150.         mkv_write_seekhead(pb, mkv->main_seekhead);
              ^
1151. 
1152.         // update the duration

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

libavformat/matroskaenc.c:335:9: Assignment
  333. 
  334.     if (seekhead->reserved_size > 0) {
  335.         uint64_t remaining = seekhead->filepos + seekhead->reserved_size - avio_tell(pb);
               ^
  336.         put_ebml_void(pb, remaining);
  337.         avio_seek(pb, currentpos, SEEK_SET);

libavformat/matroskaenc.c:336:9: Call
  334.     if (seekhead->reserved_size > 0) {
  335.         uint64_t remaining = seekhead->filepos + seekhead->reserved_size - avio_tell(pb);
  336.         put_ebml_void(pb, remaining);
               ^
  337.         avio_seek(pb, currentpos, SEEK_SET);
  338. 

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

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

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