]> git.sesse.net Git - ffmpeg/commitdiff
lavf/jacosubdec: fix FPE in case timeres is badly set.
authorClément Bœsch <ubitux@gmail.com>
Fri, 29 Jun 2012 17:38:09 +0000 (19:38 +0200)
committerClément Bœsch <ubitux@gmail.com>
Fri, 29 Jun 2012 18:19:59 +0000 (20:19 +0200)
libavformat/jacosubdec.c

index 4c82650692497d9f73fe2718615319ad88e2b9d1..cc4b978daebfbfd2ee2440334f8925b1a0ba6e9f 100644 (file)
@@ -219,7 +219,10 @@ static int jacosub_read_header(AVFormatContext *s)
             break;
         case 'T': // ...but must be placed after TIMERES
             jacosub->timeres = strtol(p, NULL, 10);
-            av_bprintf(&header, "#T %s", p);
+            if (!jacosub->timeres)
+                jacosub->timeres = 30;
+            else
+                av_bprintf(&header, "#T %s", p);
             break;
         }
     }