libavformat/matroskaenc.c:1189: error: Integer Overflow R2
  ([0, +oo] + [-oo, +oo]):signed32.

libavformat/matroskaenc.c:1187:13: <LHS trace>
1185.         size -= start - data;
1186.         sscanf(data, "Dialogue: %d,", &layer);
1187.         i = snprintf(buffer, sizeof(buffer), "%" PRId64 ",%d,",
                  ^
1188.                      s->streams[pkt->stream_index]->nb_frames, layer);
1189.         size = FFMIN(i + size, sizeof(buffer));

libavformat/matroskaenc.c:1187:13: Risky value from: snprintf
1185.         size -= start - data;
1186.         sscanf(data, "Dialogue: %d,", &layer);
1187.         i = snprintf(buffer, sizeof(buffer), "%" PRId64 ",%d,",
                  ^
1188.                      s->streams[pkt->stream_index]->nb_frames, layer);
1189.         size = FFMIN(i + size, sizeof(buffer));

libavformat/matroskaenc.c:1187:9: Assignment
1185.         size -= start - data;
1186.         sscanf(data, "Dialogue: %d,", &layer);
1187.         i = snprintf(buffer, sizeof(buffer), "%" PRId64 ",%d,",
              ^
1188.                      s->streams[pkt->stream_index]->nb_frames, layer);
1189.         size = FFMIN(i + size, sizeof(buffer));

libavformat/matroskaenc.c:1166:1: <RHS trace>
1164. }
1165. 
1166. static int mkv_write_ass_blocks(AVFormatContext *s, AVIOContext *pb,
      ^
1167.                                 AVPacket *pkt)
1168. {

libavformat/matroskaenc.c:1166:1: Parameter `*pkt->data`
1164. }
1165. 
1166. static int mkv_write_ass_blocks(AVFormatContext *s, AVIOContext *pb,
      ^
1167.                                 AVPacket *pkt)
1168. {

libavformat/matroskaenc.c:1171:5: Assignment
1169.     MatroskaMuxContext *mkv = s->priv_data;
1170.     int i, layer = 0, max_duration = 0, size, line_size, data_size = pkt->size;
1171.     uint8_t *start, *end, *data = pkt->data;
          ^
1172.     ebml_master blockgroup;
1173.     char buffer[2048];

libavformat/matroskaenc.c:1185:9: Assignment
1183.             if (!(start = memchr(start, ',', size - (start - data))))
1184.                 return max_duration;
1185.         size -= start - data;
              ^
1186.         sscanf(data, "Dialogue: %d,", &layer);
1187.         i = snprintf(buffer, sizeof(buffer), "%" PRId64 ",%d,",

libavformat/matroskaenc.c:1189:16: Binary operation: ([0, +oo] + [-oo, +oo]):signed32
1187.         i = snprintf(buffer, sizeof(buffer), "%" PRId64 ",%d,",
1188.                      s->streams[pkt->stream_index]->nb_frames, layer);
1189.         size = FFMIN(i + size, sizeof(buffer));
                     ^
1190.         memcpy(buffer + i, start, size - i);
1191. 
