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

libavformat/matroskaenc.c:792:15: Call
790.         ret = mkv_add_seekhead_entry(mkv->main_seekhead, MATROSKA_ID_CUES    , cuespos);
791.         if (ret < 0) return ret;
792.         ret = mkv_add_seekhead_entry(mkv->main_seekhead, MATROSKA_ID_SEEKHEAD, second_seekhead);
                   ^
793.         if (ret < 0) return ret;
794.         mkv_write_seekhead(pb, mkv->main_seekhead);

libavformat/matroskaenc.c:266:1: Parameter `seekhead->entries->segmentpos`
  264. }
  265. 
  266. static int mkv_add_seekhead_entry(mkv_seekhead *seekhead, unsigned int elementid, uint64_t filepos)
       ^
  267. {
  268.     mkv_seekhead_entry *entries = seekhead->entries;

libavformat/matroskaenc.c:794:9: Call
792.         ret = mkv_add_seekhead_entry(mkv->main_seekhead, MATROSKA_ID_SEEKHEAD, second_seekhead);
793.         if (ret < 0) return ret;
794.         mkv_write_seekhead(pb, mkv->main_seekhead);
             ^
795. 
796.         // update the duration

libavformat/matroskaenc.c:293:1: Parameter `seekhead->filepos`
  291.  * @return The file offset where the seekhead was written.
  292.  */
  293. static offset_t mkv_write_seekhead(ByteIOContext *pb, mkv_seekhead *seekhead)
       ^
  294. {
  295.     ebml_master metaseek, seekentry;

libavformat/matroskaenc.c:320:9: Assignment
  318. 
  319.     if (seekhead->reserved_size > 0) {
  320.         uint64_t remaining = seekhead->filepos + seekhead->reserved_size - url_ftell(pb);
               ^
  321.         put_ebml_void(pb, remaining);
  322.         url_fseek(pb, currentpos, SEEK_SET);

libavformat/matroskaenc.c:321:9: Call
  319.     if (seekhead->reserved_size > 0) {
  320.         uint64_t remaining = seekhead->filepos + seekhead->reserved_size - url_ftell(pb);
  321.         put_ebml_void(pb, remaining);
               ^
  322.         url_fseek(pb, currentpos, SEEK_SET);
  323. 

libavformat/matroskaenc.c:188:1: <LHS trace>
186.  * @param size The number of bytes to reserve, which must be at least 2.
187.  */
188. static void put_ebml_void(ByteIOContext *pb, uint64_t size)
     ^
189. {
190.     offset_t currentpos = url_ftell(pb);

libavformat/matroskaenc.c:188:1: Parameter `size`
    186.  * @param size The number of bytes to reserve, which must be at least 2.
    187.  */
    188. static void put_ebml_void(ByteIOContext *pb, uint64_t size)
         ^
    189. {
    190.     offset_t currentpos = url_ftell(pb);

libavformat/matroskaenc.c:199:9: Binary operation: ([0, 9] - 1):unsigned64 by call to `mkv_write_seekhead` 
    197.     // size if possible, 1 byte otherwise
    198.     if (size < 10)
    199.         put_ebml_num(pb, size-1, 0);
                 ^
    200.     else
    201.         put_ebml_num(pb, size-9, 8);
