]> git.sesse.net Git - ffmpeg/blobdiff - libavformat/jacosubdec.c
avformat/wsddec: Fix undefined shift
[ffmpeg] / libavformat / jacosubdec.c
index 520c435cc5afc8f41f4b79cea8dbddf47ab44209..50144f7e214be82766e18cf1ecec7361bd1a2603 100644 (file)
@@ -48,7 +48,7 @@ static int timed_line(const char *ptr)
             (sscanf(ptr, "@%u @%u %c", &fs, &fe, &c) == 3 && fs < fe));
 }
 
-static int jacosub_probe(AVProbeData *p)
+static int jacosub_probe(const AVProbeData *p)
 {
     const char *ptr     = p->buf;
     const char *ptr_end = p->buf + p->buf_size;
@@ -127,7 +127,7 @@ shift_and_ret:
     ts_start  = (ts_start + jacosub->shift) * 100 / jacosub->timeres;
     ts_end    = (ts_end   + jacosub->shift) * 100 / jacosub->timeres;
     *start    = ts_start;
-    *duration = ts_start + ts_end;
+    *duration = ts_end - ts_start;
     return buf + len;
 }